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

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
...@@ -53,10 +53,8 @@ static int ad7606_par_probe(struct platform_device *pdev) ...@@ -53,10 +53,8 @@ static int ad7606_par_probe(struct platform_device *pdev)
int irq; int irq;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "no irq: %d\n", irq);
return irq; return irq;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
addr = devm_ioremap_resource(&pdev->dev, res); addr = devm_ioremap_resource(&pdev->dev, res);
......
...@@ -1179,10 +1179,8 @@ static int at91_adc_probe(struct platform_device *pdev) ...@@ -1179,10 +1179,8 @@ static int at91_adc_probe(struct platform_device *pdev)
idev->info = &at91_adc_info; idev->info = &at91_adc_info;
st->irq = platform_get_irq(pdev, 0); st->irq = platform_get_irq(pdev, 0);
if (st->irq < 0) { if (st->irq < 0)
dev_err(&pdev->dev, "No IRQ ID is designated\n");
return -ENODEV; return -ENODEV;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
...@@ -225,10 +225,8 @@ static int axp288_adc_probe(struct platform_device *pdev) ...@@ -225,10 +225,8 @@ static int axp288_adc_probe(struct platform_device *pdev)
info = iio_priv(indio_dev); info = iio_priv(indio_dev);
info->irq = platform_get_irq(pdev, 0); info->irq = platform_get_irq(pdev, 0);
if (info->irq < 0) { if (info->irq < 0)
dev_err(&pdev->dev, "no irq resource?\n");
return info->irq; return info->irq;
}
platform_set_drvdata(pdev, indio_dev); platform_set_drvdata(pdev, indio_dev);
info->regmap = axp20x->regmap; info->regmap = axp20x->regmap;
/* /*
......
...@@ -540,11 +540,8 @@ static int iproc_adc_probe(struct platform_device *pdev) ...@@ -540,11 +540,8 @@ static int iproc_adc_probe(struct platform_device *pdev)
} }
adc_priv->irqno = platform_get_irq(pdev, 0); adc_priv->irqno = platform_get_irq(pdev, 0);
if (adc_priv->irqno <= 0) { if (adc_priv->irqno <= 0)
dev_err(&pdev->dev, "platform_get_irq failed\n"); return -ENODEV;
ret = -ENODEV;
return ret;
}
ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2, ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2,
IPROC_ADC_AUXIN_SCAN_ENA, 0); IPROC_ADC_AUXIN_SCAN_ENA, 0);
......
...@@ -337,10 +337,8 @@ static int da9150_gpadc_probe(struct platform_device *pdev) ...@@ -337,10 +337,8 @@ static int da9150_gpadc_probe(struct platform_device *pdev)
init_completion(&gpadc->complete); init_completion(&gpadc->complete);
irq = platform_get_irq_byname(pdev, "GPADC"); irq = platform_get_irq_byname(pdev, "GPADC");
if (irq < 0) { if (irq < 0)
dev_err(dev, "Failed to get IRQ: %d\n", irq);
return irq; return irq;
}
ret = devm_request_threaded_irq(dev, irq, NULL, da9150_gpadc_irq, ret = devm_request_threaded_irq(dev, irq, NULL, da9150_gpadc_irq,
IRQF_ONESHOT, "GPADC", gpadc); IRQF_ONESHOT, "GPADC", gpadc);
......
...@@ -357,11 +357,8 @@ static int envelope_detector_probe(struct platform_device *pdev) ...@@ -357,11 +357,8 @@ static int envelope_detector_probe(struct platform_device *pdev)
} }
env->comp_irq = platform_get_irq_byname(pdev, "comp"); env->comp_irq = platform_get_irq_byname(pdev, "comp");
if (env->comp_irq < 0) { if (env->comp_irq < 0)
if (env->comp_irq != -EPROBE_DEFER)
dev_err(dev, "failed to get compare interrupt\n");
return env->comp_irq; return env->comp_irq;
}
ret = devm_request_irq(dev, env->comp_irq, envelope_detector_comp_isr, ret = devm_request_irq(dev, env->comp_irq, envelope_detector_comp_isr,
0, "envelope-detector", env); 0, "envelope-detector", env);
......
...@@ -805,10 +805,8 @@ static int exynos_adc_probe(struct platform_device *pdev) ...@@ -805,10 +805,8 @@ static int exynos_adc_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "no irq resource?\n");
return irq; return irq;
}
info->irq = irq; info->irq = irq;
irq = platform_get_irq(pdev, 1); irq = platform_get_irq(pdev, 1);
......
...@@ -340,7 +340,6 @@ static int mx25_gcq_probe(struct platform_device *pdev) ...@@ -340,7 +340,6 @@ static int mx25_gcq_probe(struct platform_device *pdev)
priv->irq = platform_get_irq(pdev, 0); priv->irq = platform_get_irq(pdev, 0);
if (priv->irq <= 0) { if (priv->irq <= 0) {
dev_err(dev, "Failed to get IRQ\n");
ret = priv->irq; ret = priv->irq;
if (!ret) if (!ret)
ret = -ENXIO; ret = -ENXIO;
......
...@@ -492,10 +492,8 @@ static int imx7d_adc_probe(struct platform_device *pdev) ...@@ -492,10 +492,8 @@ static int imx7d_adc_probe(struct platform_device *pdev)
return PTR_ERR(info->regs); return PTR_ERR(info->regs);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "No irq resource?\n");
return irq; return irq;
}
info->clk = devm_clk_get(dev, "adc"); info->clk = devm_clk_get(dev, "adc");
if (IS_ERR(info->clk)) { if (IS_ERR(info->clk)) {
......
...@@ -172,10 +172,8 @@ static int lpc32xx_adc_probe(struct platform_device *pdev) ...@@ -172,10 +172,8 @@ static int lpc32xx_adc_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0)
dev_err(&pdev->dev, "failed getting interrupt resource\n");
return -ENXIO; return -ENXIO;
}
retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0, retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0,
LPC32XXAD_NAME, st); LPC32XXAD_NAME, st);
......
...@@ -225,7 +225,6 @@ static int npcm_adc_probe(struct platform_device *pdev) ...@@ -225,7 +225,6 @@ static int npcm_adc_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
dev_err(dev, "failed getting interrupt resource\n");
ret = -EINVAL; ret = -EINVAL;
goto err_disable_clk; goto err_disable_clk;
} }
......
...@@ -244,10 +244,8 @@ static int rockchip_saradc_probe(struct platform_device *pdev) ...@@ -244,10 +244,8 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
init_completion(&info->completion); init_completion(&info->completion);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "no irq resource?\n");
return irq; return irq;
}
ret = devm_request_irq(&pdev->dev, irq, rockchip_saradc_isr, ret = devm_request_irq(&pdev->dev, irq, rockchip_saradc_isr,
0, dev_name(&pdev->dev), info); 0, dev_name(&pdev->dev), info);
......
...@@ -529,10 +529,8 @@ static int sc27xx_adc_probe(struct platform_device *pdev) ...@@ -529,10 +529,8 @@ static int sc27xx_adc_probe(struct platform_device *pdev)
} }
sc27xx_data->irq = platform_get_irq(pdev, 0); sc27xx_data->irq = platform_get_irq(pdev, 0);
if (sc27xx_data->irq < 0) { if (sc27xx_data->irq < 0)
dev_err(dev, "failed to get ADC irq number\n");
return sc27xx_data->irq; return sc27xx_data->irq;
}
ret = of_hwspin_lock_get_id(np, 0); ret = of_hwspin_lock_get_id(np, 0);
if (ret < 0) { if (ret < 0) {
......
...@@ -301,7 +301,6 @@ static int spear_adc_probe(struct platform_device *pdev) ...@@ -301,7 +301,6 @@ static int spear_adc_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
dev_err(dev, "failed getting interrupt resource\n");
ret = -EINVAL; ret = -EINVAL;
goto errout2; goto errout2;
} }
......
...@@ -374,7 +374,6 @@ static int stm32_adc_irq_probe(struct platform_device *pdev, ...@@ -374,7 +374,6 @@ static int stm32_adc_irq_probe(struct platform_device *pdev,
*/ */
if (i && priv->irq[i] == -ENXIO) if (i && priv->irq[i] == -ENXIO)
continue; continue;
dev_err(&pdev->dev, "failed to get irq\n");
return priv->irq[i]; return priv->irq[i];
} }
......
...@@ -1919,10 +1919,8 @@ static int stm32_adc_probe(struct platform_device *pdev) ...@@ -1919,10 +1919,8 @@ static int stm32_adc_probe(struct platform_device *pdev)
} }
adc->irq = platform_get_irq(pdev, 0); adc->irq = platform_get_irq(pdev, 0);
if (adc->irq < 0) { if (adc->irq < 0)
dev_err(&pdev->dev, "failed to get irq\n");
return adc->irq; return adc->irq;
}
ret = devm_request_irq(&pdev->dev, adc->irq, stm32_adc_isr, ret = devm_request_irq(&pdev->dev, adc->irq, stm32_adc_isr,
0, pdev->name, adc); 0, pdev->name, adc);
......
...@@ -1601,11 +1601,8 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev) ...@@ -1601,11 +1601,8 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
* So IRQ associated to filter instance 0 is dedicated to the Filter 0. * So IRQ associated to filter instance 0 is dedicated to the Filter 0.
*/ */
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
if (irq != -EPROBE_DEFER)
dev_err(dev, "Failed to get IRQ: %d\n", irq);
return irq; return irq;
}
ret = devm_request_irq(dev, irq, stm32_dfsdm_irq, ret = devm_request_irq(dev, irq, stm32_dfsdm_irq,
0, pdev->name, adc); 0, pdev->name, adc);
......
...@@ -460,10 +460,8 @@ static int sun4i_irq_init(struct platform_device *pdev, const char *name, ...@@ -460,10 +460,8 @@ static int sun4i_irq_init(struct platform_device *pdev, const char *name,
atomic_set(atomic, 1); atomic_set(atomic, 1);
ret = platform_get_irq_byname(pdev, name); ret = platform_get_irq_byname(pdev, name);
if (ret < 0) { if (ret < 0)
dev_err(&pdev->dev, "no %s interrupt registered\n", name);
return ret; return ret;
}
ret = regmap_irq_get_virq(mfd_dev->regmap_irqc, ret); ret = regmap_irq_get_virq(mfd_dev->regmap_irqc, ret);
if (ret < 0) { if (ret < 0) {
......
...@@ -905,10 +905,8 @@ static int twl6030_gpadc_probe(struct platform_device *pdev) ...@@ -905,10 +905,8 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "failed to get irq\n");
return irq; return irq;
}
ret = devm_request_threaded_irq(dev, irq, NULL, ret = devm_request_threaded_irq(dev, irq, NULL,
twl6030_gpadc_irq_handler, twl6030_gpadc_irq_handler,
......
...@@ -821,10 +821,8 @@ static int vf610_adc_probe(struct platform_device *pdev) ...@@ -821,10 +821,8 @@ static int vf610_adc_probe(struct platform_device *pdev)
return PTR_ERR(info->regs); return PTR_ERR(info->regs);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "no irq resource?\n");
return irq; return irq;
}
ret = devm_request_irq(info->dev, irq, ret = devm_request_irq(info->dev, irq,
vf610_adc_isr, 0, vf610_adc_isr, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment