linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-gpio@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq()
Date: Tue, 30 Jul 2019 11:15:15 -0700	[thread overview]
Message-ID: <20190730181557.90391-16-swboyd@chromium.org> (raw)
In-Reply-To: <20190730181557.90391-1-swboyd@chromium.org>

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: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: linux-gpio@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---

Please apply directly to subsystem trees

 drivers/gpio/gpio-brcmstb.c       | 4 +---
 drivers/gpio/gpio-eic-sprd.c      | 4 +---
 drivers/gpio/gpio-grgpio.c        | 2 --
 drivers/gpio/gpio-max77620.c      | 4 +---
 drivers/gpio/gpio-pmic-eic-sprd.c | 4 +---
 drivers/gpio/gpio-sprd.c          | 4 +---
 drivers/gpio/gpio-tb10x.c         | 4 +---
 drivers/gpio/gpio-tegra.c         | 4 +---
 drivers/gpio/gpio-zx.c            | 1 -
 drivers/gpio/gpio-zynq.c          | 4 +---
 10 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index af936dcca659..05e3f99ae59c 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -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;
 	}
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index 7b9ac4a12c20..fe7a73f52329 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -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++) {
 		/*
diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c
index 0937b605e134..08234e64993a 100644
--- a/drivers/gpio/gpio-grgpio.c
+++ b/drivers/gpio/gpio-grgpio.c
@@ -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;
diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index b7d89e30131e..47d05e357e61 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -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)
diff --git a/drivers/gpio/gpio-pmic-eic-sprd.c b/drivers/gpio/gpio-pmic-eic-sprd.c
index 24228cf79afc..05000cace9b2 100644
--- a/drivers/gpio/gpio-pmic-eic-sprd.c
+++ b/drivers/gpio/gpio-pmic-eic-sprd.c
@@ -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)
diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
index f5c8b3a351d5..d7314d39ab65 100644
--- a/drivers/gpio/gpio-sprd.c
+++ b/drivers/gpio/gpio-sprd.c
@@ -226,10 +226,8 @@ static int sprd_gpio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	sprd_gpio->irq = platform_get_irq(pdev, 0);
-	if (sprd_gpio->irq < 0) {
-		dev_err(&pdev->dev, "Failed to get GPIO interrupt.\n");
+	if (sprd_gpio->irq < 0)
 		return sprd_gpio->irq;
-	}
 
 	sprd_gpio->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sprd_gpio->base))
diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index bd1f3f775ce9..5e375186f90e 100644
--- a/drivers/gpio/gpio-tb10x.c
+++ b/drivers/gpio/gpio-tb10x.c
@@ -171,10 +171,8 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
 		struct irq_chip_generic *gc;
 
 		ret = platform_get_irq(pdev, 0);
-		if (ret < 0) {
-			dev_err(dev, "No interrupt specified.\n");
+		if (ret < 0)
 			return ret;
-		}
 
 		tb10x_gpio->gc.to_irq	= tb10x_gpio_to_irq;
 		tb10x_gpio->irq		= ret;
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 0f59161a4701..8a01d3694b28 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -624,10 +624,8 @@ static int tegra_gpio_probe(struct platform_device *pdev)
 
 	for (i = 0; i < tgi->bank_count; i++) {
 		ret = platform_get_irq(pdev, i);
-		if (ret < 0) {
-			dev_err(&pdev->dev, "Missing IRQ resource: %d\n", ret);
+		if (ret < 0)
 			return ret;
-		}
 
 		bank = &tgi->bank_info[i];
 		bank->bank = i;
diff --git a/drivers/gpio/gpio-zx.c b/drivers/gpio/gpio-zx.c
index 8637adb6bc20..8d9b9bf8510a 100644
--- a/drivers/gpio/gpio-zx.c
+++ b/drivers/gpio/gpio-zx.c
@@ -253,7 +253,6 @@ static int zx_gpio_probe(struct platform_device *pdev)
 	writew_relaxed(0, chip->base + ZX_GPIO_IE);
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(dev, "invalid IRQ\n");
 		gpiochip_remove(&chip->gc);
 		return -ENODEV;
 	}
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index f241b6c13dbe..86b0bd256c13 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -849,10 +849,8 @@ static int zynq_gpio_probe(struct platform_device *pdev)
 		return PTR_ERR(gpio->base_addr);
 
 	gpio->irq = platform_get_irq(pdev, 0);
-	if (gpio->irq < 0) {
-		dev_err(&pdev->dev, "invalid IRQ\n");
+	if (gpio->irq < 0)
 		return gpio->irq;
-	}
 
 	/* configure the gpio chip */
 	chip = &gpio->chip;
-- 
Sent by a computer through tubes


  parent reply	other threads:[~2019-07-30 18:16 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 18:15 [PATCH v6 00/57] Add error message to platform_get_irq*() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 01/57] ata: Remove dev_err() usage after platform_get_irq() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 02/57] bus: sunxi-rsb: " Stephen Boyd
2019-08-05  3:35   ` Chen-Yu Tsai
2019-08-05 20:44     ` Stephen Boyd
2019-08-06  6:20       ` Chen-Yu Tsai
2019-07-30 18:15 ` [PATCH v6 03/57] hwrng: " Stephen Boyd
2019-08-09  6:17   ` Herbert Xu
2019-07-30 18:15 ` [PATCH v6 04/57] clocksource: " Stephen Boyd
2019-08-08  7:47   ` Geert Uytterhoeven
2019-08-09  6:56   ` Daniel Lezcano
2019-07-30 18:15 ` [PATCH v6 05/57] crypto: " Stephen Boyd
2019-08-09  6:17   ` Herbert Xu
2019-07-30 18:15 ` [PATCH v6 06/57] cpufreq: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 07/57] ARM: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 08/57] MIPS: " Stephen Boyd
2019-08-26 11:05   ` Paul Burton
2019-07-30 18:15 ` [PATCH v6 09/57] devfreq: " Stephen Boyd
2019-07-31  0:21   ` Chanwoo Choi
2019-07-30 18:15 ` [PATCH v6 10/57] dmaengine: " Stephen Boyd
2019-07-31 15:28   ` Vinod Koul
2019-07-30 18:15 ` [PATCH v6 11/57] edac: " Stephen Boyd
2019-08-02 17:04   ` James Morse
2019-07-30 18:15 ` [PATCH v6 12/57] extcon: " Stephen Boyd
2019-07-31  0:20   ` Chanwoo Choi
2019-07-30 18:15 ` [PATCH v6 13/57] firmware: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 14/57] fpga: " Stephen Boyd
2019-08-31 20:55   ` Moritz Fischer
2019-07-30 18:15 ` Stephen Boyd [this message]
2019-07-31  7:28   ` [PATCH v6 15/57] gpio: " Bartosz Golaszewski
2019-08-05 11:26   ` Linus Walleij
2019-07-30 18:15 ` [PATCH v6 16/57] HSI: " Stephen Boyd
2019-07-30 20:44   ` Sebastian Reichel
2019-07-30 18:15 ` [PATCH v6 17/57] hwmon: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 18/57] i2c: " Stephen Boyd
2019-07-31 14:30   ` Wolfram Sang
2019-07-31 14:46     ` Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 19/57] iio: " Stephen Boyd
2019-07-31  6:42   ` Phil Reid
2019-07-31 14:32     ` Stephen Boyd
2019-08-01  2:37       ` Phil Reid
2019-08-05 15:01         ` Jonathan Cameron
2019-08-05 15:00   ` Jonathan Cameron
2019-07-30 18:15 ` [PATCH v6 20/57] infiniband: " Stephen Boyd
2019-07-31 15:53   ` Doug Ledford
2019-07-30 18:15 ` [PATCH v6 21/57] Input: " Stephen Boyd
2019-08-14 17:48   ` Dmitry Torokhov
2019-07-30 18:15 ` [PATCH v6 22/57] iommu: " Stephen Boyd
2019-08-09 15:33   ` Joerg Roedel
2019-07-30 18:15 ` [PATCH v6 23/57] irqchip: " Stephen Boyd
2019-08-07 14:23   ` Marc Zyngier
2019-07-30 18:15 ` [PATCH v6 24/57] mailbox: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 25/57] media: " Stephen Boyd
2019-08-08  7:56   ` Geert Uytterhoeven
2019-07-30 18:15 ` [PATCH v6 26/57] memory: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 27/57] mfd: " Stephen Boyd
2019-08-12  9:39   ` Lee Jones
2019-07-30 18:15 ` [PATCH v6 28/57] pcie-gadget-spear: " Stephen Boyd
2019-07-30 18:29   ` Arnd Bergmann
2019-07-31 14:16     ` Stephen Boyd
2019-08-05 16:05       ` Greg Kroah-Hartman
2019-07-30 18:15 ` [PATCH v6 29/57] mmc: " Stephen Boyd
2019-08-02 15:16   ` Ulf Hansson
2019-08-08  7:58   ` Geert Uytterhoeven
2019-07-30 18:15 ` [PATCH v6 30/57] mtd: " Stephen Boyd
2019-10-08 17:25   ` Miquel Raynal
2019-07-30 18:15 ` [PATCH v6 31/57] pci: " Stephen Boyd
2019-07-30 21:56   ` Bjorn Helgaas
2019-08-07 14:09     ` Marc Gonzalez
2019-08-07 22:08       ` Bjorn Helgaas
2019-08-08  8:02   ` Geert Uytterhoeven
2019-08-10  8:20   ` Linus Walleij
2019-07-30 18:15 ` [PATCH v6 32/57] perf: " Stephen Boyd
2019-07-31  8:40   ` Will Deacon
2019-07-31 14:07     ` Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 33/57] pinctrl: " Stephen Boyd
2019-08-05 11:24   ` Linus Walleij
2019-07-30 18:15 ` [PATCH v6 34/57] pinctrl: intel: " Stephen Boyd
2019-07-30 18:32   ` Andy Shevchenko
2019-08-01 13:57   ` Andy Shevchenko
2019-07-30 18:15 ` [PATCH v6 35/57] power: supply: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 36/57] pwm: " Stephen Boyd
2019-07-31  6:58   ` Uwe Kleine-König
2019-07-31  7:13     ` Greg Kroah-Hartman
2019-07-31  7:39       ` Uwe Kleine-König
2019-07-30 18:15 ` [PATCH v6 37/57] regulator: " Stephen Boyd
2019-08-02 11:22   ` Applied "regulator: Remove dev_err() usage after platform_get_irq()" to the regulator tree Mark Brown
2019-07-30 18:15 ` [PATCH v6 38/57] remoteproc: Remove dev_err() usage after platform_get_irq() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 39/57] rtc: " Stephen Boyd
2019-08-08  8:05   ` Geert Uytterhoeven
2019-08-13  8:53   ` Alexandre Belloni
2019-07-30 18:15 ` [PATCH v6 40/57] soc: " Stephen Boyd
2019-07-30 18:35   ` Bjorn Andersson
2019-07-30 21:26     ` Leo Li
2019-07-30 21:36       ` Stephen Boyd
2019-07-31 18:50         ` Li Yang
2019-07-30 21:36     ` [PATCH v7 1/2] soc: fsl: qbman: " Stephen Boyd
2019-07-30 21:36     ` [PATCH v7 2/2] soc: qcom: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 41/57] spi: " Stephen Boyd
2019-08-02 11:22   ` Applied "spi: Remove dev_err() usage after platform_get_irq()" to the spi tree Mark Brown
2019-08-08  8:09   ` [PATCH v6 41/57] spi: Remove dev_err() usage after platform_get_irq() Geert Uytterhoeven
2019-07-30 18:15 ` [PATCH v6 42/57] staging: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 43/57] thermal: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 44/57] tty: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 45/57] uio: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 46/57] usb: " Stephen Boyd
2019-08-08 12:40   ` Felipe Balbi
2019-07-30 18:15 ` [PATCH v6 47/57] video: " Stephen Boyd
2020-01-03 11:29   ` Bartlomiej Zolnierkiewicz
2019-07-30 18:15 ` [PATCH v6 48/57] watchdog: " Stephen Boyd
2019-07-30 18:41   ` Guenter Roeck
2019-07-30 18:15 ` [PATCH v6 49/57] ASoC: " Stephen Boyd
2019-08-02 11:21   ` Applied "ASoC: Remove dev_err() usage after platform_get_irq()" to the asoc tree Mark Brown
2019-07-30 18:15 ` [PATCH v6 50/57] gpu: Remove dev_err() usage after platform_get_irq() Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 51/57] net: " Stephen Boyd
2019-07-30 21:25   ` David Miller
2019-07-30 18:15 ` [PATCH v6 52/57] platform/x86: intel_pmc_ipc: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 53/57] platform/mellanox: mlxreg-hotplug: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 54/57] platform/x86: intel_bxtwc_tmu: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 55/57] platform/x86: intel_int0002_vgpio: " Stephen Boyd
2019-08-01 15:11   ` Andy Shevchenko
2019-07-30 18:15 ` [PATCH v6 56/57] scsi: " Stephen Boyd
2019-07-30 18:15 ` [PATCH v6 57/57] ALSA: x86: " Stephen Boyd
2019-07-31  8:23 ` [PATCH v6 00/57] Add error message to platform_get_irq*() Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190730181557.90391-16-swboyd@chromium.org \
    --to=swboyd@chromium.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).