Commit 7c279229 authored by Stephen Boyd's avatar Stephen Boyd Committed by Jonathan Cameron
Browse files

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: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent d3017f5f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -53,10 +53,8 @@ static int ad7606_par_probe(struct platform_device *pdev)
	int irq;

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(&pdev->dev, "no irq: %d\n", irq);
	if (irq < 0)
		return irq;
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	addr = devm_ioremap_resource(&pdev->dev, res);
+1 −3
Original line number Diff line number Diff line
@@ -1179,10 +1179,8 @@ static int at91_adc_probe(struct platform_device *pdev)
	idev->info = &at91_adc_info;

	st->irq = platform_get_irq(pdev, 0);
	if (st->irq < 0) {
		dev_err(&pdev->dev, "No IRQ ID is designated\n");
	if (st->irq < 0)
		return -ENODEV;
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

+1 −3
Original line number Diff line number Diff line
@@ -225,10 +225,8 @@ static int axp288_adc_probe(struct platform_device *pdev)

	info = iio_priv(indio_dev);
	info->irq = platform_get_irq(pdev, 0);
	if (info->irq < 0) {
		dev_err(&pdev->dev, "no irq resource?\n");
	if (info->irq < 0)
		return info->irq;
	}
	platform_set_drvdata(pdev, indio_dev);
	info->regmap = axp20x->regmap;
	/*
+2 −5
Original line number Diff line number Diff line
@@ -540,11 +540,8 @@ static int iproc_adc_probe(struct platform_device *pdev)
	}

	adc_priv->irqno = platform_get_irq(pdev, 0);
	if (adc_priv->irqno <= 0) {
		dev_err(&pdev->dev, "platform_get_irq failed\n");
		ret = -ENODEV;
		return ret;
	}
	if (adc_priv->irqno <= 0)
		return -ENODEV;

	ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2,
				IPROC_ADC_AUXIN_SCAN_ENA, 0);
+1 −3
Original line number Diff line number Diff line
@@ -337,10 +337,8 @@ static int da9150_gpadc_probe(struct platform_device *pdev)
	init_completion(&gpadc->complete);

	irq = platform_get_irq_byname(pdev, "GPADC");
	if (irq < 0) {
		dev_err(dev, "Failed to get IRQ: %d\n", irq);
	if (irq < 0)
		return irq;
	}

	ret = devm_request_threaded_irq(dev, irq, NULL, da9150_gpadc_irq,
					IRQF_ONESHOT, "GPADC", gpadc);
Loading