From 666a493b5e1408eb74496dbb48851a474eec5ac9 Mon Sep 17 00:00:00 2001 From: Yingyuan Zhu Date: Wed, 29 Aug 2018 18:44:34 +0800 Subject: [PATCH] touchscreen: goodix_gt1x: fix coverity warning PD#172714: touchscreen: goodix_gt1x: fix coverity warning The value of "ret" variable is overridden by the new value before it is used. This causes "Unused value". Change-Id: Ie48b58668c4f4077606d69d5bafbd8d59264ae7e Signed-off-by: Yingyuan Zhu --- drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x.c b/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x.c index 509b716..c2c8e5e 100644 --- a/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x.c +++ b/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x.c @@ -398,7 +398,7 @@ static s32 gt1x_request_io_port(void) ret = gpio_request(GTP_INT_PORT, "GTP_INT_IRQ"); if (ret < 0) { GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_INT_PORT, ret); - ret = -ENODEV; + return -ENODEV; } else { GTP_GPIO_AS_INT(GTP_INT_PORT); gt1x_i2c_client->irq = GTP_INT_IRQ; @@ -407,14 +407,11 @@ static s32 gt1x_request_io_port(void) ret = gpio_request(GTP_RST_PORT, "GTP_RST_PORT"); if (ret < 0) { GTP_ERROR("Failed to request GPIO:%d, ERRNO:%d", (s32) GTP_RST_PORT, ret); - ret = -ENODEV; + gpio_free(GTP_INT_PORT); + return -ENODEV; } GTP_GPIO_AS_INPUT(GTP_RST_PORT); - if (ret < 0) { - gpio_free(GTP_RST_PORT); - gpio_free(GTP_INT_PORT); - } return ret; } -- 2.7.4