drm/mediatek: add a error return value when clock driver has been prepared
authorBibby Hsieh <bibby.hsieh@mediatek.com>
Wed, 3 Oct 2018 03:41:51 +0000 (11:41 +0800)
committerCK Hu <ck.hu@mediatek.com>
Wed, 3 Oct 2018 03:56:33 +0000 (11:56 +0800)
DRM driver get the comp->clk by of_clk_get(), we only
assign NULL to comp->clk when error happened, but do
not return the error number.

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: CK Hu <ck.hu@mediatek.com>
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c

index ff974d82a4a67a918fb08f2fee2bcc073f91e648..54ca794db3e91c98842e409ba7826fcb90d6d8ff 100644 (file)
@@ -294,7 +294,7 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node,
        comp->irq = of_irq_get(node, 0);
        comp->clk = of_clk_get(node, 0);
        if (IS_ERR(comp->clk))
-               comp->clk = NULL;
+               return PTR_ERR(comp->clk);
 
        /* Only DMA capable components need the LARB property */
        comp->larb_dev = NULL;