Commit 0bec8b7e authored by Stephen Boyd's avatar Stephen Boyd Committed by Dmitry Torokhov
Browse files

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: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent f5d4c647
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -413,10 +413,8 @@ static int bcm_kp_probe(struct platform_device *pdev)
	bcm_kp_stop(kp);

	kp->irq = platform_get_irq(pdev, 0);
	if (kp->irq < 0) {
		dev_err(&pdev->dev, "no IRQ specified\n");
	if (kp->irq < 0)
		return -EINVAL;
	}

	error = devm_request_threaded_irq(&pdev->dev, kp->irq,
					  NULL, bcm_kp_isr_thread,
+0 −1
Original line number Diff line number Diff line
@@ -192,7 +192,6 @@ static int __init davinci_ks_probe(struct platform_device *pdev)

	davinci_ks->irq = platform_get_irq(pdev, 0);
	if (davinci_ks->irq < 0) {
		dev_err(dev, "no key scan irq\n");
		error = davinci_ks->irq;
		goto fail2;
	}
+1 −3
Original line number Diff line number Diff line
@@ -430,10 +430,8 @@ static int imx_keypad_probe(struct platform_device *pdev)
	}

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(&pdev->dev, "no irq defined in platform data\n");
	if (irq < 0)
		return irq;
	}

	input_dev = devm_input_allocate_device(&pdev->dev);
	if (!input_dev) {
+1 −3
Original line number Diff line number Diff line
@@ -172,10 +172,8 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
	}

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(&pdev->dev, "failed to get platform irq\n");
	if (irq < 0)
		return -EINVAL;
	}

	kscandat = devm_kzalloc(&pdev->dev, sizeof(*kscandat),
				GFP_KERNEL);
+1 −3
Original line number Diff line number Diff line
@@ -235,10 +235,8 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
	}

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(&pdev->dev, "failed to get keypad irq\n");
	if (irq < 0)
		return -EINVAL;
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
Loading