summaryrefslogtreecommitdiff
path: root/drivers/memory
diff options
context:
space:
mode:
authorYong Wu <yong.wu@mediatek.com>2021-09-14 14:36:56 +0300
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-09-22 09:42:57 +0300
commit30b869e77a1c626190bbbe6b4e5f5382b0102ac3 (patch)
tree171fc336946fd040532df3582b0c25b36778b5c1 /drivers/memory
parent534e0ad2ed4f9296a8c7ccb1a393bc4d5000dbad (diff)
downloadlinux-30b869e77a1c626190bbbe6b4e5f5382b0102ac3.tar.xz
memory: mtk-smi: Add error handle for smi_probe
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: 6ce2c05b2118 ("memory: mtk-smi: Add device-link between smi-larb and smi-common") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/mtk-smi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index 33b6c5efe102..b362d528944e 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -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)