If we have a USB charger connected, reboot is flakey and often fails to
reboot the device with the charger LED staying on.
Let's fix this by implementing .shutdown.
Cc: Arthur Demchenkov <spinal.by@gmail.com>
Cc: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
return 0;
}
-static int cpcap_charger_remove(struct platform_device *pdev)
+static void cpcap_charger_shutdown(struct platform_device *pdev)
{
struct cpcap_charger_ddata *ddata = platform_get_drvdata(pdev);
int error;
error);
cancel_delayed_work_sync(&ddata->vbus_work);
cancel_delayed_work_sync(&ddata->detect_work);
+}
+
+static int cpcap_charger_remove(struct platform_device *pdev)
+{
+ cpcap_charger_shutdown(pdev);
return 0;
}
.name = "cpcap-charger",
.of_match_table = of_match_ptr(cpcap_charger_id_table),
},
+ .shutdown = cpcap_charger_shutdown,
.remove = cpcap_charger_remove,
};
module_platform_driver(cpcap_charger_driver);