staging:iio:ad7606: fix ptr_ret.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Sat, 22 Oct 2016 19:12:42 +0000 (03:12 +0800)
committerJonathan Cameron <jic23@kernel.org>
Sun, 23 Oct 2016 18:34:27 +0000 (19:34 +0100)
drivers/staging/iio/adc/ad7606.c:357:1-3: WARNING: PTR_ERR_OR_ZERO can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/ad7606.c

index b0ae04a449eaf92fda0f568803534b247af3e71f..453190864b2ffc60b9b7515ce55ee53f2ad1c11e 100644 (file)
@@ -354,10 +354,7 @@ static int ad7606_request_gpios(struct ad7606_state *st)
 
        st->gpio_os = devm_gpiod_get_array_optional(dev, "oversampling-ratio",
                        GPIOD_OUT_LOW);
-       if (IS_ERR(st->gpio_os))
-               return PTR_ERR(st->gpio_os);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(st->gpio_os);
 }
 
 /**