From cc813917361f266511b1dd7621c492bddeae2ea0 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Mon, 12 Aug 2013 12:57:25 +0800 Subject: [PATCH] ENGR00274749 ARM: imx6q: Improve lvds cabc gpio request logic 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 --- arch/arm/mach-imx/mach-imx6q.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index b8b92827ebf6..c7f9478dc263 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -216,20 +216,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"); } } -- 2.39.5