video: fbdev: pxafb: Handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 14 Jun 2017 15:40:56 +0000 (17:40 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Wed, 14 Jun 2017 15:40:56 +0000 (17:40 +0200)
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/pxafb.c

index b21a89b03fb474a4a1c5b8821ad8861cd55b7e35..c3d49e13643cd21504d7ffa62f1231d6a9a8ef38 100644 (file)
@@ -1436,7 +1436,10 @@ static void pxafb_enable_controller(struct pxafb_info *fbi)
        pr_debug("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3);
 
        /* enable LCD controller clock */
-       clk_prepare_enable(fbi->clk);
+       if (clk_prepare_enable(fbi->clk)) {
+               pr_err("%s: Failed to prepare clock\n", __func__);
+               return;
+       }
 
        if (fbi->lccr0 & LCCR0_LCDT)
                return;