iio: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:19 +0000 (11:15 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 5 Aug 2019 14:59:14 +0000 (15:59 +0100)
commit7c279229f980e5423c946fd692860b4071e0c708
treecb61bf0a12a9cca8d26d2cf89110daf7317bb818
parentd3017f5fbb2dc597b8cc9b59144c63d9a1396392
iio: Remove dev_err() usage after platform_get_irq()

We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 files changed:
drivers/iio/adc/ad7606_par.c
drivers/iio/adc/at91_adc.c
drivers/iio/adc/axp288_adc.c
drivers/iio/adc/bcm_iproc_adc.c
drivers/iio/adc/da9150-gpadc.c
drivers/iio/adc/envelope-detector.c
drivers/iio/adc/exynos_adc.c
drivers/iio/adc/fsl-imx25-gcq.c
drivers/iio/adc/imx7d_adc.c
drivers/iio/adc/lpc32xx_adc.c
drivers/iio/adc/npcm_adc.c
drivers/iio/adc/rockchip_saradc.c
drivers/iio/adc/sc27xx_adc.c
drivers/iio/adc/spear_adc.c
drivers/iio/adc/stm32-adc-core.c
drivers/iio/adc/stm32-adc.c
drivers/iio/adc/stm32-dfsdm-adc.c
drivers/iio/adc/sun4i-gpadc-iio.c
drivers/iio/adc/twl6030-gpadc.c
drivers/iio/adc/vf610_adc.c