From: kbuild test robot Date: Sat, 22 Oct 2016 19:12:42 +0000 (+0800) Subject: staging:iio:ad7606: fix ptr_ret.cocci warnings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dbdef9ba693a5ac7d92368cef7d436b3093e9f4e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging:iio:ad7606: fix ptr_ret.cocci warnings 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 Signed-off-by: Fengguang Wu Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/adc/ad7606.c b/drivers/staging/iio/adc/ad7606.c index b0ae04a449ea..453190864b2f 100644 --- a/drivers/staging/iio/adc/ad7606.c +++ b/drivers/staging/iio/adc/ad7606.c @@ -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); } /**