clk: amba-clcd: convert to clk_prepare()/clk_unprepare()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 22 Sep 2011 11:34:31 +0000 (12:34 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 27 Sep 2011 08:25:51 +0000 (09:25 +0100)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/video/amba-clcd.c

index cf03ad0671472f2aaecbcd4fec7d462cf29d01e5..2cda6ba0939b2e73472368e0c34109493c1dbc90 100644 (file)
@@ -447,6 +447,10 @@ static int clcdfb_register(struct clcd_fb *fb)
                goto out;
        }
 
+       ret = clk_prepare(fb->clk);
+       if (ret)
+               goto free_clk;
+
        fb->fb.device           = &fb->dev->dev;
 
        fb->fb.fix.mmio_start   = fb->dev->res.start;
@@ -456,7 +460,7 @@ static int clcdfb_register(struct clcd_fb *fb)
        if (!fb->regs) {
                printk(KERN_ERR "CLCD: unable to remap registers\n");
                ret = -ENOMEM;
-               goto free_clk;
+               goto clk_unprep;
        }
 
        fb->fb.fbops            = &clcdfb_ops;
@@ -530,6 +534,8 @@ static int clcdfb_register(struct clcd_fb *fb)
        fb_dealloc_cmap(&fb->fb.cmap);
  unmap:
        iounmap(fb->regs);
+ clk_unprep:
+       clk_unprepare(fb->clk);
  free_clk:
        clk_put(fb->clk);
  out:
@@ -595,6 +601,7 @@ static int clcdfb_remove(struct amba_device *dev)
        if (fb->fb.cmap.len)
                fb_dealloc_cmap(&fb->fb.cmap);
        iounmap(fb->regs);
+       clk_unprepare(fb->clk);
        clk_put(fb->clk);
 
        fb->board->remove(fb);