mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
gpio: of: correct notifier return codes
According to the comments in linux/notifier.h, the code to return when a notifications is "not for us" is NOTIFY_DONE, not NOTIFY_OK. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
f42dafe3da
commit
7e12c495a3
1 changed files with 8 additions and 8 deletions
|
@ -834,14 +834,14 @@ static int of_gpio_notify(struct notifier_block *nb, unsigned long action,
|
|||
switch (of_reconfig_get_state_change(action, arg)) {
|
||||
case OF_RECONFIG_CHANGE_ADD:
|
||||
if (!of_property_read_bool(rd->dn, "gpio-hog"))
|
||||
return NOTIFY_OK; /* not for us */
|
||||
return NOTIFY_DONE; /* not for us */
|
||||
|
||||
if (of_node_test_and_set_flag(rd->dn, OF_POPULATED))
|
||||
return NOTIFY_OK;
|
||||
return NOTIFY_DONE;
|
||||
|
||||
chip = of_find_gpiochip_by_node(rd->dn->parent);
|
||||
if (chip == NULL)
|
||||
return NOTIFY_OK; /* not for us */
|
||||
return NOTIFY_DONE; /* not for us */
|
||||
|
||||
ret = of_gpiochip_add_hog(chip, rd->dn);
|
||||
if (ret < 0) {
|
||||
|
@ -850,22 +850,22 @@ static int of_gpio_notify(struct notifier_block *nb, unsigned long action,
|
|||
of_node_clear_flag(rd->dn, OF_POPULATED);
|
||||
return notifier_from_errno(ret);
|
||||
}
|
||||
break;
|
||||
return NOTIFY_OK;
|
||||
|
||||
case OF_RECONFIG_CHANGE_REMOVE:
|
||||
if (!of_node_check_flag(rd->dn, OF_POPULATED))
|
||||
return NOTIFY_OK; /* already depopulated */
|
||||
return NOTIFY_DONE; /* already depopulated */
|
||||
|
||||
chip = of_find_gpiochip_by_node(rd->dn->parent);
|
||||
if (chip == NULL)
|
||||
return NOTIFY_OK; /* not for us */
|
||||
return NOTIFY_DONE; /* not for us */
|
||||
|
||||
of_gpiochip_remove_hog(chip, rd->dn);
|
||||
of_node_clear_flag(rd->dn, OF_POPULATED);
|
||||
break;
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
struct notifier_block gpio_of_notifier = {
|
||||
|
|
Loading…
Reference in a new issue