mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
gpio: adp5585: use devm_blocking_notifier_chain_register()
Replace the blocking_notifier_chain_register() + devm_add_action_or_reset() pattern with a single call to devm_blocking_notifier_chain_register(), removing the adp5585_gpio_unreg_notifier() callback. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20260816060648.4030-6-farbere@amazon.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
This commit is contained in:
parent
08b3b3adeb
commit
870f46a42a
|
|
@ -390,16 +390,6 @@ static const struct irq_chip adp5585_irq_chip = {
|
|||
GPIOCHIP_IRQ_RESOURCE_HELPERS,
|
||||
};
|
||||
|
||||
static void adp5585_gpio_unreg_notifier(void *data)
|
||||
{
|
||||
struct adp5585_gpio_dev *adp5585_gpio = data;
|
||||
struct device *dev = adp5585_gpio->gpio_chip.parent;
|
||||
struct adp5585_dev *adp5585 = dev_get_drvdata(dev->parent);
|
||||
|
||||
blocking_notifier_chain_unregister(&adp5585->event_notifier,
|
||||
&adp5585_gpio->nb);
|
||||
}
|
||||
|
||||
static int adp5585_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct adp5585_dev *adp5585 = dev_get_drvdata(pdev->dev.parent);
|
||||
|
|
@ -450,13 +440,9 @@ static int adp5585_gpio_probe(struct platform_device *pdev)
|
|||
girq->threaded = true;
|
||||
|
||||
adp5585_gpio->nb.notifier_call = adp5585_gpio_key_event;
|
||||
ret = blocking_notifier_chain_register(&adp5585->event_notifier,
|
||||
&adp5585_gpio->nb);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_add_action_or_reset(dev, adp5585_gpio_unreg_notifier,
|
||||
adp5585_gpio);
|
||||
ret = devm_blocking_notifier_chain_register(dev,
|
||||
&adp5585->event_notifier,
|
||||
&adp5585_gpio->nb);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user