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>
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");
}
}