diff options
author | Himangi Saraogi | 2014-06-28 22:53:55 +0530 |
---|---|---|
committer | Mike Turquette | 2014-07-01 23:37:34 -0700 |
commit | c3dcac875e35c2e67ccaef10ef62ae5b1410d29c (patch) | |
tree | b06b9a2b138484be1c276d6d537eec751526cd1d /drivers/clk/sunxi/clk-sun6i-apb0-gates.c | |
parent | 2a96dfa49c83a2a7cbdb11382976aaa6b2636764 (diff) |
clk: sunxi: fix devm_ioremap_resource error detection code
devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
A simplified version of the semantic match that finds this problem is as
follows:
// <smpl>
@@
expression e,e1;
statement S;
@@
*e = devm_ioremap_resource(...);
if (!e1) S
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Acked-by Boris BREZILLON <boris.brezillon@free-electrons.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/sunxi/clk-sun6i-apb0-gates.c')
-rw-r--r-- | drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c index 44cd27c5c401..670f90d629d7 100644 --- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c +++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c @@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); reg = devm_ioremap_resource(&pdev->dev, r); - if (!reg) + if (IS_ERR(reg)) return PTR_ERR(reg); clk_parent = of_clk_get_parent_name(np, 0); |