Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15bddb7d authored by Stephen Boyd's avatar Stephen Boyd Committed by Linus Walleij
Browse files

gpio: 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: linux-gpio@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-16-swboyd@chromium.org


Acked-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 74d2d0e6
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -636,10 +636,8 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)

	if (of_property_read_bool(np, "interrupt-controller")) {
		priv->parent_irq = platform_get_irq(pdev, 0);
		if (priv->parent_irq <= 0) {
			dev_err(dev, "Couldn't get IRQ");
		if (priv->parent_irq <= 0)
			return -ENOENT;
		}
	} else {
		priv->parent_irq = -ENOENT;
	}
+1 −3
Original line number Diff line number Diff line
@@ -584,10 +584,8 @@ static int sprd_eic_probe(struct platform_device *pdev)
	sprd_eic->type = pdata->type;

	sprd_eic->irq = platform_get_irq(pdev, 0);
	if (sprd_eic->irq < 0) {
		dev_err(&pdev->dev, "Failed to get EIC interrupt.\n");
	if (sprd_eic->irq < 0)
		return sprd_eic->irq;
	}

	for (i = 0; i < SPRD_EIC_MAX_BANK; i++) {
		/*
+0 −2
Original line number Diff line number Diff line
@@ -408,8 +408,6 @@ static int grgpio_probe(struct platform_device *ofdev)
				 * Continue without irq functionality for that
				 * gpio line
				 */
				dev_err(priv->dev,
					"Failed to get irq for offset %d\n", i);
				continue;
			}
			priv->uirqs[lirq->index].uirq = ret;
+1 −3
Original line number Diff line number Diff line
@@ -270,10 +270,8 @@ static int max77620_gpio_probe(struct platform_device *pdev)
	int ret;

	gpio_irq = platform_get_irq(pdev, 0);
	if (gpio_irq <= 0) {
		dev_err(&pdev->dev, "GPIO irq not available %d\n", gpio_irq);
	if (gpio_irq <= 0)
		return -ENODEV;
	}

	mgpio = devm_kzalloc(&pdev->dev, sizeof(*mgpio), GFP_KERNEL);
	if (!mgpio)
+1 −3
Original line number Diff line number Diff line
@@ -305,10 +305,8 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)
	mutex_init(&pmic_eic->buslock);

	pmic_eic->irq = platform_get_irq(pdev, 0);
	if (pmic_eic->irq < 0) {
		dev_err(&pdev->dev, "Failed to get PMIC EIC interrupt.\n");
	if (pmic_eic->irq < 0)
		return pmic_eic->irq;
	}

	pmic_eic->map = dev_get_regmap(pdev->dev.parent, NULL);
	if (!pmic_eic->map)
Loading