staging: msm/lcdc.c: Convert IS_ERR result to PTR_ERR
authorJulia Lawall <julia@diku.dk>
Thu, 27 Jan 2011 15:49:07 +0000 (16:49 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 31 Jan 2011 21:44:05 +0000 (13:44 -0800)
This code elsewhere returns a negative constant to an indicate an error,
while IS_ERR returns the result of a >= operation.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

 if (...) { ...
- return IS_ERR(x);
+ return PTR_ERR(x);
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/msm/lcdc.c

index 735280ab72cbb4f3f1345b5752d35e31abf7d0aa..8183394aef7611bfca68c13c5cd6aef4242ba293 100644 (file)
@@ -224,12 +224,12 @@ static int __init lcdc_driver_init(void)
        mdp_lcdc_pclk_clk = clk_get(NULL, "mdp_lcdc_pclk_clk");
        if (IS_ERR(mdp_lcdc_pclk_clk)) {
                printk(KERN_ERR "error: can't get mdp_lcdc_pclk_clk!\n");
-               return IS_ERR(mdp_lcdc_pclk_clk);
+               return PTR_ERR(mdp_lcdc_pclk_clk);
        }
        mdp_lcdc_pad_pclk_clk = clk_get(NULL, "mdp_lcdc_pad_pclk_clk");
        if (IS_ERR(mdp_lcdc_pad_pclk_clk)) {
                printk(KERN_ERR "error: can't get mdp_lcdc_pad_pclk_clk!\n");
-               return IS_ERR(mdp_lcdc_pad_pclk_clk);
+               return PTR_ERR(mdp_lcdc_pad_pclk_clk);
        }
 //     pm_qos_add_requirement(PM_QOS_SYSTEM_BUS_FREQ , "lcdc",
 //                             PM_QOS_DEFAULT_VALUE);