提交 30b869e7 编写于 作者: Y Yong Wu 提交者: Krzysztof Kozlowski

memory: mtk-smi: Add error handle for smi_probe

Add error handle while component_add fail.
Signed-off-by: NYong Wu <yong.wu@mediatek.com>
Reviewed-by: NIkjoon Jang <ikjn@chromium.org>
Link: https://lore.kernel.org/r/20210914113703.31466-7-yong.wu@mediatek.com
Fixes: 6ce2c05b ("memory: mtk-smi: Add device-link between smi-larb and smi-common")
Signed-off-by: NKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
上级 534e0ad2
...@@ -338,7 +338,15 @@ static int mtk_smi_larb_probe(struct platform_device *pdev) ...@@ -338,7 +338,15 @@ static int mtk_smi_larb_probe(struct platform_device *pdev)
pm_runtime_enable(dev); pm_runtime_enable(dev);
platform_set_drvdata(pdev, larb); 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) static int mtk_smi_larb_remove(struct platform_device *pdev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册