Skip to content

Commit

Permalink
power: supply: axp20x_usb_power: fix work-queue init
Browse files Browse the repository at this point in the history
The commit 6d0c5de
("power: supply: Clean-up few drivers by using managed work init")
Re-introduced wrong order of initializing work-queue and requesting
the IRQs which was originally fixed by the commit b5e8642
("power: supply: axp20x_usb_power: Init work before enabling IRQs")

In addition this caused the work queue to be initialized twice.

Fix it again.

Fixes: 6d0c5de ("power: supply: Clean-up few drivers by using managed work init")
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reported-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/a774ca25010b7c932c07f22ce8a548466705c023.1616574973.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Matti Vaittinen authored and Greg Kroah-Hartman committed Mar 26, 2021
1 parent a7d30f3 commit ecdc996
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/power/supply/axp20x_usb_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,11 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
power->axp20x_id = axp_data->axp20x_id;
power->regmap = axp20x->regmap;
power->num_irqs = axp_data->num_irq_names;
INIT_DELAYED_WORK(&power->vbus_detect, axp20x_usb_power_poll_vbus);

ret = devm_delayed_work_autocancel(&pdev->dev, &power->vbus_detect,
axp20x_usb_power_poll_vbus);
if (ret)
return ret;

if (power->axp20x_id == AXP202_ID) {
/* Enable vbus valid checking */
Expand Down Expand Up @@ -647,10 +651,6 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
}
}

ret = devm_delayed_work_autocancel(&pdev->dev, &power->vbus_detect,
axp20x_usb_power_poll_vbus);
if (ret)
return ret;
if (axp20x_usb_vbus_needs_polling(power))
queue_delayed_work(system_power_efficient_wq, &power->vbus_detect, 0);

Expand Down

0 comments on commit ecdc996

Please sign in to comment.