diff mbox series

power: supply: axp288_charger: use devm_add_action_or_reset

Message ID 1608208594-29081-1-git-send-email-tiantao6@hisilicon.com
State New
Headers show
Series power: supply: axp288_charger: use devm_add_action_or_reset | expand

Commit Message

Tian Tao Dec. 17, 2020, 12:36 p.m. UTC
When devm_add_action returns non-zero, it will return directly and
there is no place to call axp288_charger_cancel_work, while when
devm_add_action_or_reset returns non-zero, the system will
automatically call axp288_charger_cancel_work.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/power/supply/axp288_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index a4df1ea..6480c2e 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -855,7 +855,7 @@  static int axp288_charger_probe(struct platform_device *pdev)
 	}
 
 	/* Cancel our work on cleanup, register this before the notifiers */
-	ret = devm_add_action(dev, axp288_charger_cancel_work, info);
+	ret = devm_add_action_or_reset(dev, axp288_charger_cancel_work, info);
 	if (ret)
 		return ret;