power: rk818-charger: fix cancel delayed work error because of not initialize

Change-Id: I2273c55f2ffbc5d09cf80bbfdf3030acada39eab
Signed-off-by: chenjh <chenjh@rock-chips.com>
This commit is contained in:
chenjh 2017-04-24 10:26:25 +08:00
parent e8be46e733
commit be4b15c304

View File

@ -1283,9 +1283,13 @@ static void rk818_charger_shutdown(struct platform_device *pdev)
{
struct rk818_charger *cg = platform_get_drvdata(pdev);
cancel_delayed_work_sync(&cg->host_work);
/* type-c only */
if (cg->pdata->extcon) {
cancel_delayed_work_sync(&cg->host_work);
cancel_delayed_work_sync(&cg->discnt_work);
}
cancel_delayed_work_sync(&cg->usb_work);
cancel_delayed_work_sync(&cg->discnt_work);
cancel_delayed_work_sync(&cg->dc_work);
cancel_delayed_work_sync(&cg->finish_sig_work);
cancel_delayed_work_sync(&cg->irq_work);