gpio: don't do a pthread_kill if thread id is 0
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -187,7 +187,10 @@ maa_result_t
|
||||
maa_gpio_isr_exit(maa_gpio_context *dev)
|
||||
{
|
||||
maa_result_t ret = MAA_SUCCESS;
|
||||
maa_gpio_edge_mode(dev, MAA_GPIO_EDGE_NONE);
|
||||
|
||||
if (dev->thread_id == 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (pthread_kill(dev->thread_id) != 0) {
|
||||
ret = MAA_ERROR_INVALID_HANDLE;
|
||||
@@ -196,6 +199,11 @@ maa_gpio_isr_exit(maa_gpio_context *dev)
|
||||
ret = MAA_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// this is only required if we had an isr setup
|
||||
if (ret == MAA_SUCCESS) {
|
||||
ret = maa_gpio_edge_mode(dev, MAA_GPIO_EDGE_NONE);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user