]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: rockchip: pm: Fix PTR_ERR() argument
authorFabio Estevam <fabio.estevam@freescale.com>
Fri, 14 Aug 2015 02:43:19 +0000 (23:43 -0300)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 24 Aug 2015 10:39:14 +0000 (12:39 +0200)
PTR_ERR should access the value just tested by IS_ERR.

The semantic patch that makes this change is available
in scripts/coccinelle/tests/odd_ptr_err.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm/mach-rockchip/pm.c

index 156cd23dfba561f7b270514544dbc42a61210c0b..bee8c80519299269cde5ba9c852243d6e5a47b05 100644 (file)
@@ -246,14 +246,14 @@ static int rk3288_suspend_init(struct device_node *np)
                                "rockchip,rk3288-sgrf");
        if (IS_ERR(sgrf_regmap)) {
                pr_err("%s: could not find sgrf regmap\n", __func__);
-               return PTR_ERR(pmu_regmap);
+               return PTR_ERR(sgrf_regmap);
        }
 
        grf_regmap = syscon_regmap_lookup_by_compatible(
                                "rockchip,rk3288-grf");
        if (IS_ERR(grf_regmap)) {
                pr_err("%s: could not find grf regmap\n", __func__);
-               return PTR_ERR(pmu_regmap);
+               return PTR_ERR(grf_regmap);
        }
 
        sram_np = of_find_compatible_node(NULL, NULL,