summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-sysfs.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2015-05-04 18:10:42 +0300
committerLinus Walleij <linus.walleij@linaro.org>2015-05-12 11:47:31 +0300
commite4339ce32372e2f8c98222c0923b79476c29a309 (patch)
treef81edf1c95b6189fb0d11fc81d8991ad68047b52 /drivers/gpio/gpiolib-sysfs.c
parent2ec74a959354dde38155e62f0af3ee0b1a7283ac (diff)
downloadlinux-e4339ce32372e2f8c98222c0923b79476c29a309.tar.xz
gpio: sysfs: clean up edge_store
Remove goto from success path. Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.c')
-rw-r--r--drivers/gpio/gpiolib-sysfs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index d9b3faa01fee..1161a46618dd 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -236,14 +236,16 @@ static ssize_t edge_store(struct device *dev,
struct gpio_desc *desc = data->desc;
unsigned long flags;
ssize_t status = size;
- int i;
+ int i;
- for (i = 0; i < ARRAY_SIZE(trigger_types); i++)
+ for (i = 0; i < ARRAY_SIZE(trigger_types); i++) {
if (sysfs_streq(trigger_types[i].name, buf))
- goto found;
- return -EINVAL;
+ break;
+ }
+
+ if (i == ARRAY_SIZE(trigger_types))
+ return -EINVAL;
-found:
flags = trigger_types[i].flags;
mutex_lock(&sysfs_lock);