Input: 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).

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Stephen Boyd
2019-08-14 10:46:38 -07:00
committed by Dmitry Torokhov
parent f5d4c647d0
commit 0bec8b7e5c
37 changed files with 44 additions and 142 deletions

View File

@@ -185,10 +185,8 @@ static int pm860x_touch_probe(struct platform_device *pdev)
int irq, ret, res_x = 0, data = 0;
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "No IRQ resource!\n");
if (irq < 0)
return -EINVAL;
}
if (pm860x_touch_dt_init(pdev, chip, &res_x)) {
if (pdata) {

View File

@@ -489,10 +489,8 @@ static int iproc_ts_probe(struct platform_device *pdev)
/* get interrupt */
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "platform_get_irq failed: %d\n", irq);
if (irq < 0)
return irq;
}
error = devm_request_irq(&pdev->dev, irq,
iproc_touchscreen_interrupt,

View File

@@ -526,10 +526,8 @@ static int mx25_tcq_probe(struct platform_device *pdev)
}
priv->irq = platform_get_irq(pdev, 0);
if (priv->irq <= 0) {
dev_err(dev, "Failed to get IRQ\n");
if (priv->irq <= 0)
return priv->irq;
}
idev = devm_input_allocate_device(dev);
if (!idev) {

View File

@@ -430,16 +430,12 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
}
tsc_irq = platform_get_irq(pdev, 0);
if (tsc_irq < 0) {
dev_err(&pdev->dev, "no tsc irq resource?\n");
if (tsc_irq < 0)
return tsc_irq;
}
adc_irq = platform_get_irq(pdev, 1);
if (adc_irq < 0) {
dev_err(&pdev->dev, "no adc irq resource?\n");
if (adc_irq < 0)
return adc_irq;
}
err = devm_request_threaded_irq(tsc->dev, tsc_irq,
NULL, tsc_irq_fn, IRQF_ONESHOT,

View File

@@ -212,10 +212,8 @@ static int lpc32xx_ts_probe(struct platform_device *pdev)
}
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "Can't get interrupt resource\n");
if (irq < 0)
return irq;
}
tsc = kzalloc(sizeof(*tsc), GFP_KERNEL);
input = input_allocate_device();