Private
Public Access
2
0

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:
Brendan Le Foll
2014-05-07 17:45:02 +01:00
parent 0986b5aa92
commit 356c7afacd

View File

@@ -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;
}