drivers/gpio: Manage callback addition/removal properly
It needs to verify if the callback was not already installed, and if so: if is was in controller's list. It should return an error in case the node is not found though it was requested to be removed. If already inserted, it will be silently removed but added again, to avoid circular list as stated in the bug. Fixes #11394 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
4043909d69
commit
064f5f0cef
20 changed files with 37 additions and 59 deletions
|
@ -338,9 +338,7 @@ static int gpio_intel_apl_manage_callback(struct device *dev,
|
|||
{
|
||||
struct gpio_intel_apl_data *data = dev->driver_data;
|
||||
|
||||
_gpio_manage_callback(&data->cb, callback, set);
|
||||
|
||||
return 0;
|
||||
return _gpio_manage_callback(&data->cb, callback, set);
|
||||
}
|
||||
|
||||
static int gpio_intel_apl_enable_callback(struct device *dev,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue