clk: mvebu: cp110: make failure labels more meaningful
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Fri, 7 Apr 2017 13:47:08 +0000 (15:47 +0200)
committerGregory CLEMENT <gregory.clement@free-electrons.com>
Thu, 1 Jun 2017 14:07:35 +0000 (16:07 +0200)
In preparation to the addition of a new clock, rename the goto labels
used to handle the failure cases using a name related to the failure
cause. This will allow to insert additional failing cases without
renaming all the labels.

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
drivers/clk/mvebu/cp110-system-controller.c

index 6b11d7b3e0e090a9369ca264f08038c34cf8d0cd..3b27a6056c7331ff77c0e4fd3c8ca572f929b26f 100644 (file)
@@ -221,7 +221,7 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
                                        1000 * 1000 * 1000);
        if (IS_ERR(hw)) {
                ret = PTR_ERR(hw);
-               goto fail0;
+               goto fail_apll;
        }
 
        cp110_clks[CP110_CORE_APLL] = hw;
@@ -232,7 +232,7 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
        hw = clk_hw_register_fixed_factor(NULL, ppv2_name, apll_name, 0, 1, 3);
        if (IS_ERR(hw)) {
                ret = PTR_ERR(hw);
-               goto fail1;
+               goto fail_ppv2;
        }
 
        cp110_clks[CP110_CORE_PPV2] = hw;
@@ -243,7 +243,7 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
        hw = clk_hw_register_fixed_factor(NULL, eip_name, apll_name, 0, 1, 2);
        if (IS_ERR(hw)) {
                ret = PTR_ERR(hw);
-               goto fail2;
+               goto fail_eip;
        }
 
        cp110_clks[CP110_CORE_EIP] = hw;
@@ -254,7 +254,7 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
        hw = clk_hw_register_fixed_factor(NULL, core_name, eip_name, 0, 1, 2);
        if (IS_ERR(hw)) {
                ret = PTR_ERR(hw);
-               goto fail3;
+               goto fail_core;
        }
 
        cp110_clks[CP110_CORE_CORE] = hw;
@@ -270,7 +270,7 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
                                                   core_name, 0, 1, 1);
        if (IS_ERR(hw)) {
                ret = PTR_ERR(hw);
-               goto fail4;
+               goto fail_nand;
        }
 
        cp110_clks[CP110_CORE_NAND] = hw;
@@ -365,15 +365,15 @@ fail_gate:
        }
 
        clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_NAND]);
-fail4:
+fail_nand:
        clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_CORE]);
-fail3:
+fail_core:
        clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_EIP]);
-fail2:
+fail_eip:
        clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_PPV2]);
-fail1:
+fail_ppv2:
        clk_hw_unregister_fixed_rate(cp110_clks[CP110_CORE_APLL]);
-fail0:
+fail_apll:
        return ret;
 }