Skip to content

Commit 6c53937

Browse files
kcxtsre
authored andcommitted
power: supply: qcom_pmi8998_charger: fix wakeirq
Unloading and reloading the driver (e.g. when built as a module) currently leads to errors trying to enable wake IRQ since it's already enabled. Use devm to manage this for us so it correctly gets disabled when removing the driver. Additionally, call device_init_wakeup() so that charger attach/remove will trigger a wakeup by default. Fixes: 8648aeb ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver") Signed-off-by: Casey Connolly <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 2937f5d commit 6c53937

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/power/supply/qcom_pmi8998_charger.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,9 @@ static int smb2_probe(struct platform_device *pdev)
10161016
if (rc < 0)
10171017
return rc;
10181018

1019-
rc = dev_pm_set_wake_irq(chip->dev, chip->cable_irq);
1019+
devm_device_init_wakeup(chip->dev);
1020+
1021+
rc = devm_pm_set_wake_irq(chip->dev, chip->cable_irq);
10201022
if (rc < 0)
10211023
return dev_err_probe(chip->dev, rc, "Couldn't set wake irq\n");
10221024

0 commit comments

Comments
 (0)