]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00274749 ARM: imx6q: Improve lvds cabc gpio request logic
authorLiu Ying <Ying.Liu@freescale.com>
Mon, 12 Aug 2013 04:57:25 +0000 (12:57 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 14:06:18 +0000 (16:06 +0200)
This patch removes the unnecessary gpio_set_value() and
gpio_free() function calls after request the gpios with
gpio_requestion_one() successfully. Also, this patch adds
a warning message if the request fails.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
arch/arm/mach-imx/mach-imx6q.c

index 09892acf8e7f87e33010693fbca1d80afb7400b8..47af9aeedfe5e909f15335554bd7ea3f22948eee 100644 (file)
@@ -303,20 +303,16 @@ static void __init imx6q_lvds_cabc_init(void)
        if (gpio_is_valid(lvds0_gpio)) {
                ret = gpio_request_one(lvds0_gpio, GPIOF_OUT_INIT_LOW,
                                "LVDS0 CABC enable");
-               if (!ret) {
-                       gpio_set_value(lvds0_gpio, 0);
-                       gpio_free(lvds0_gpio);
-               }
+               if (ret)
+                       pr_warn("failed to request LVDS0 CABC gpio\n");
        }
 
        lvds1_gpio = of_get_named_gpio(np, "lvds1-gpios", 0);
        if (gpio_is_valid(lvds1_gpio)) {
                ret = gpio_request_one(lvds1_gpio, GPIOF_OUT_INIT_LOW,
                                "LVDS1 CABC enable");
-               if (!ret) {
-                       gpio_set_value(lvds1_gpio, 0);
-                       gpio_free(lvds1_gpio);
-               }
+               if (ret)
+                       pr_warn("failed to request LVDS1 CABC gpio\n");
        }
 }