Commit 5738d49f authored by Yang Yingliang's avatar Yang Yingliang Committed by Sebastian Reichel

power: supply: mt6370: Fix return value check in mt6370_chg_probe()

If create_singlethread_workqueue() fails, it returns a null pointer,
replace IS_ERR() check with NULL pointer check.

Fixes: 233cb8a4 ("power: supply: mt6370: Add MediaTek MT6370 charger driver")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarChiaEn Wu <chiaen_wu@richtek.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent fe259a21
...@@ -911,8 +911,8 @@ static int mt6370_chg_probe(struct platform_device *pdev) ...@@ -911,8 +911,8 @@ static int mt6370_chg_probe(struct platform_device *pdev)
priv->attach = MT6370_ATTACH_STAT_DETACH; priv->attach = MT6370_ATTACH_STAT_DETACH;
priv->wq = create_singlethread_workqueue(dev_name(priv->dev)); priv->wq = create_singlethread_workqueue(dev_name(priv->dev));
if (IS_ERR(priv->wq)) if (!priv->wq)
return dev_err_probe(dev, PTR_ERR(priv->wq), return dev_err_probe(dev, -ENOMEM,
"Failed to create workqueue\n"); "Failed to create workqueue\n");
ret = devm_add_action_or_reset(dev, mt6370_chg_destroy_wq, priv->wq); ret = devm_add_action_or_reset(dev, mt6370_chg_destroy_wq, priv->wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment