Skip to content

Commit

Permalink
memory: mtk-smi: Add error handle for smi_probe
Browse files Browse the repository at this point in the history
Add error handle while component_add fail.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Ikjoon Jang <ikjn@chromium.org>
Link: https://lore.kernel.org/r/20210914113703.31466-7-yong.wu@mediatek.com
Fixes: 6ce2c05 ("memory: mtk-smi: Add device-link between smi-larb and smi-common")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
  • Loading branch information
Yong Wu authored and Krzysztof Kozlowski committed Sep 22, 2021
1 parent 534e0ad commit 30b869e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/memory/mtk-smi.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,15 @@ static int mtk_smi_larb_probe(struct platform_device *pdev)

pm_runtime_enable(dev);
platform_set_drvdata(pdev, larb);
return component_add(dev, &mtk_smi_larb_component_ops);
ret = component_add(dev, &mtk_smi_larb_component_ops);
if (ret)
goto err_pm_disable;
return 0;

err_pm_disable:
pm_runtime_disable(dev);
device_link_remove(dev, larb->smi_common_dev);
return ret;
}

static int mtk_smi_larb_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 30b869e

Please sign in to comment.