Skip to contentSkip to conversation

Add error message to platform_get_irq*()

PATCH Applied Stephen Boyd 39 participants 124 messages Jul 30, 2019 – Jan 3, 2020 Page 2 of 2

Subsystems (220)
lore
Share & tools
lore
maintainer
#99 lore raw

Applied "spi: Remove dev_err() usage after platform_get_irq()" to the spi tree

In reply to Stephen Boyd

The patch

spi: Remove dev_err() usage after platform_get_irq()

has been applied to the spi tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.4

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 6b8ac10e0dd4b49eda513c1aa5045b3b1660d350 Mon Sep 17 00:00:00 2001

From: Stephen Boyd <[email protected]>
Date: Tue, 30 Jul 2019 11:15:41 -0700
Subject: [PATCH] spi: 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).

---
 drivers/spi/atmel-quadspi.c     |  1 -
 drivers/spi/spi-armada-3700.c   |  1 -
 drivers/spi/spi-bcm2835.c       |  1 -
 drivers/spi/spi-bcm2835aux.c    |  1 -
 drivers/spi/spi-bcm63xx-hsspi.c |  4 +---
 drivers/spi/spi-bcm63xx.c       |  4 +---
 drivers/spi/spi-cadence.c       |  1 -
 drivers/spi/spi-dw-mmio.c       |  4 +---
 drivers/spi/spi-efm32.c         |  4 +---
 drivers/spi/spi-ep93xx.c        |  4 +---
 drivers/spi/spi-fsl-dspi.c      |  1 -
 drivers/spi/spi-fsl-qspi.c      |  4 +---
 drivers/spi/spi-geni-qcom.c     |  4 +---
 drivers/spi/spi-lantiq-ssc.c    | 12 +++---------
 drivers/spi/spi-mt65xx.c        |  1 -
 drivers/spi/spi-npcm-pspi.c     |  1 -
 drivers/spi/spi-nuc900.c        |  1 -
 drivers/spi/spi-nxp-fspi.c      |  4 +---
 drivers/spi/spi-pic32-sqi.c     |  1 -
 drivers/spi/spi-pic32.c         | 12 +++---------
 drivers/spi/spi-qcom-qspi.c     |  4 +---
 drivers/spi/spi-s3c24xx.c       |  1 -
 drivers/spi/spi-sh-msiof.c      |  1 -
 drivers/spi/spi-sh.c            |  4 +---
 drivers/spi/spi-sifive.c        |  1 -
 drivers/spi/spi-slave-mt27xx.c  |  1 -
 drivers/spi/spi-sprd.c          |  4 +---
 drivers/spi/spi-stm32-qspi.c    |  5 +----
 drivers/spi/spi-sun4i.c         |  1 -
 drivers/spi/spi-sun6i.c         |  1 -
 drivers/spi/spi-synquacer.c     |  2 --
 drivers/spi/spi-ti-qspi.c       |  1 -
 drivers/spi/spi-uniphier.c      |  1 -
 drivers/spi/spi-xlp.c           |  4 +---
 drivers/spi/spi-zynq-qspi.c     |  1 -
 drivers/spi/spi-zynqmp-gqspi.c  |  1 -
 36 files changed, 19 insertions(+), 80 deletions(-)
drivers/spi/atmel-quadspi.c +0 -1
index 6a7d7b553d95..fd8007ebb145 100644
@@ -526,7 +526,6 @@ static int atmel_qspi_probe(struct platform_device *pdev)
 	/* Request the IRQ */
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "missing IRQ\n");
 		err = irq;
 		goto disable_qspick;
 	}
drivers/spi/spi-armada-3700.c +0 -1
index 032888344822..119ae87cc26e 100644
@@ -864,7 +864,6 @@ static int a3700_spi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(dev, "could not get irq: %d\n", irq);
 		ret = -ENXIO;
 		goto error;
 	}
drivers/spi/spi-bcm2835.c +0 -1
index 6f243a90c844..c96797844688 100644
@@ -1015,7 +1015,6 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 
 	bs->irq = platform_get_irq(pdev, 0);
 	if (bs->irq <= 0) {
-		dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq);
 		err = bs->irq ? bs->irq : -ENODEV;
 		goto out_controller_put;
 	}
drivers/spi/spi-bcm2835aux.c +0 -1
index bb57035c5770..b18ce69c0375 100644
@@ -540,7 +540,6 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
 
 	bs->irq = platform_get_irq(pdev, 0);
 	if (bs->irq <= 0) {
-		dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq);
 		err = bs->irq ? bs->irq : -ENODEV;
 		goto out_master_put;
 	}
drivers/spi/spi-bcm63xx-hsspi.c +1 -3
index 9a06ffdb73b8..373cb53579e0 100644
@@ -338,10 +338,8 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
 	u32 reg, rate, num_cs = HSSPI_SPI_MAX_CS;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "no irq: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	regs = devm_ioremap_resource(dev, res_mem);
drivers/spi/spi-bcm63xx.c +1 -3
index df1c94a131e6..fdd7eaa0b8ed 100644
@@ -520,10 +520,8 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "no irq: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	clk = devm_clk_get(dev, "spi");
 	if (IS_ERR(clk)) {
drivers/spi/spi-cadence.c +0 -1
index 7c41e4e82849..1c35eaaac838 100644
@@ -540,7 +540,6 @@ static int cdns_spi_probe(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
 		ret = -ENXIO;
-		dev_err(&pdev->dev, "irq number is invalid\n");
 		goto clk_dis_all;
 	}
 
drivers/spi/spi-dw-mmio.c +1 -3
index 4fa7e7a52ebd..edb3cf6be201 100644
@@ -156,10 +156,8 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 	}
 
 	dws->irq = platform_get_irq(pdev, 0);
-	if (dws->irq < 0) {
-		dev_err(&pdev->dev, "no irq resource?\n");
+	if (dws->irq < 0)
 		return dws->irq; /* -ENXIO */
-	}
 
 	dwsmmio->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(dwsmmio->clk))
drivers/spi/spi-efm32.c +1 -3
index eb1f2142a335..64d4c441b641 100644
@@ -400,10 +400,8 @@ static int efm32_spi_probe(struct platform_device *pdev)
 	}
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret <= 0) {
-		dev_err(&pdev->dev, "failed to get rx irq (%d)\n", ret);
+	if (ret <= 0)
 		goto err;
-	}
 
 	ddata->rxirq = ret;
 
drivers/spi/spi-ep93xx.c +1 -3
index 4034e3ec0ba2..4e1ccd4e52b6 100644
@@ -656,10 +656,8 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get irq resources\n");
+	if (irq < 0)
 		return -EBUSY;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
drivers/spi/spi-fsl-dspi.c +0 -1
index 53335ccc98f6..96eacbe6ae27 100644
@@ -1105,7 +1105,6 @@ static int dspi_probe(struct platform_device *pdev)
 	dspi_init(dspi);
 	dspi->irq = platform_get_irq(pdev, 0);
 	if (dspi->irq < 0) {
-		dev_err(&pdev->dev, "can't get platform irq\n");
 		ret = dspi->irq;
 		goto out_clk_put;
 	}
drivers/spi/spi-fsl-qspi.c +1 -3
index 41a49b93ca60..443d4c1196c2 100644
@@ -860,10 +860,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 
 	/* find the irq */
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(dev, "failed to get the irq: %d\n", ret);
+	if (ret < 0)
 		goto err_disable_clk;
-	}
 
 	ret = devm_request_irq(dev, ret,
 			fsl_qspi_irq_handler, 0, pdev->name, q);
drivers/spi/spi-geni-qcom.c +1 -3
index 5f0b0d5bfef4..242b6c86cf12 100644
@@ -539,10 +539,8 @@ static int spi_geni_probe(struct platform_device *pdev)
 	struct clk *clk;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Err getting IRQ %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(&pdev->dev, res);
drivers/spi/spi-lantiq-ssc.c +3 -9
index 8f01858c0ae6..9dfe8b04e688 100644
@@ -819,22 +819,16 @@ static int lantiq_ssc_probe(struct platform_device *pdev)
 	}
 
 	rx_irq = platform_get_irq_byname(pdev, LTQ_SPI_RX_IRQ_NAME);
-	if (rx_irq < 0) {
-		dev_err(dev, "failed to get %s\n", LTQ_SPI_RX_IRQ_NAME);
+	if (rx_irq < 0)
 		return -ENXIO;
-	}
 
 	tx_irq = platform_get_irq_byname(pdev, LTQ_SPI_TX_IRQ_NAME);
-	if (tx_irq < 0) {
-		dev_err(dev, "failed to get %s\n", LTQ_SPI_TX_IRQ_NAME);
+	if (tx_irq < 0)
 		return -ENXIO;
-	}
 
 	err_irq = platform_get_irq_byname(pdev, LTQ_SPI_ERR_IRQ_NAME);
-	if (err_irq < 0) {
-		dev_err(dev, "failed to get %s\n", LTQ_SPI_ERR_IRQ_NAME);
+	if (err_irq < 0)
 		return -ENXIO;
-	}
 
 	master = spi_alloc_master(dev, sizeof(struct lantiq_ssc_spi));
 	if (!master)
drivers/spi/spi-mt65xx.c +0 -1
index 45d8a7048b6c..1f5f716016a2 100644
@@ -664,7 +664,6 @@ static int mtk_spi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get irq (%d)\n", irq);
 		ret = irq;
 		goto err_put_master;
 	}
drivers/spi/spi-npcm-pspi.c +0 -1
index 734a2b956959..5c56caea04f0 100644
@@ -388,7 +388,6 @@ static int npcm_pspi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get IRQ\n");
 		ret = irq;
 		goto out_disable_clk;
 	}
drivers/spi/spi-nuc900.c +0 -1
index 37e2034ad4d5..f65a029e3fe9 100644
@@ -367,7 +367,6 @@ static int nuc900_spi_probe(struct platform_device *pdev)
 
 	hw->irq = platform_get_irq(pdev, 0);
 	if (hw->irq < 0) {
-		dev_err(&pdev->dev, "No IRQ specified\n");
 		err = -ENOENT;
 		goto err_pdata;
 	}
drivers/spi/spi-nxp-fspi.c +1 -3
index 8894f98cc99c..501b923f2c27 100644
@@ -1007,10 +1007,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 
 	/* find the irq */
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(dev, "failed to get the irq: %d\n", ret);
+	if (ret < 0)
 		goto err_disable_clk;
-	}
 
 	ret = devm_request_irq(dev, ret,
 			nxp_fspi_irq_handler, 0, pdev->name, f);
drivers/spi/spi-pic32-sqi.c +0 -1
index b635526ad414..11b692923fd7 100644
@@ -590,7 +590,6 @@ static int pic32_sqi_probe(struct platform_device *pdev)
 	/* irq */
 	sqi->irq = platform_get_irq(pdev, 0);
 	if (sqi->irq < 0) {
-		dev_err(&pdev->dev, "no irq found\n");
 		ret = sqi->irq;
 		goto err_free_master;
 	}
drivers/spi/spi-pic32.c +3 -9
index 10cebeaa1e6b..69f517ec59c6 100644
@@ -711,22 +711,16 @@ static int pic32_spi_hw_probe(struct platform_device *pdev,
 
 	/* get irq resources: err-irq, rx-irq, tx-irq */
 	pic32s->fault_irq = platform_get_irq_byname(pdev, "fault");
-	if (pic32s->fault_irq < 0) {
-		dev_err(&pdev->dev, "fault-irq not found\n");
+	if (pic32s->fault_irq < 0)
 		return pic32s->fault_irq;
-	}
 
 	pic32s->rx_irq = platform_get_irq_byname(pdev, "rx");
-	if (pic32s->rx_irq < 0) {
-		dev_err(&pdev->dev, "rx-irq not found\n");
+	if (pic32s->rx_irq < 0)
 		return pic32s->rx_irq;
-	}
 
 	pic32s->tx_irq = platform_get_irq_byname(pdev, "tx");
-	if (pic32s->tx_irq < 0) {
-		dev_err(&pdev->dev, "tx-irq not found\n");
+	if (pic32s->tx_irq < 0)
 		return pic32s->tx_irq;
-	}
 
 	/* get clock */
 	pic32s->clk = devm_clk_get(&pdev->dev, "mck0");
drivers/spi/spi-qcom-qspi.c +1 -3
index e0f061139c8f..a0ad73f1cc01 100644
@@ -454,10 +454,8 @@ static int qcom_qspi_probe(struct platform_device *pdev)
 		goto exit_probe_master_put;
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(dev, "Failed to get irq %d\n", ret);
+	if (ret < 0)
 		goto exit_probe_master_put;
-	}
 	ret = devm_request_irq(dev, ret, qcom_qspi_irq,
 			IRQF_TRIGGER_HIGH, dev_name(dev), ctrl);
 	if (ret) {
drivers/spi/spi-s3c24xx.c +0 -1
index 48d8dff05a3a..aea8fd98a31f 100644
@@ -545,7 +545,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev)
 
 	hw->irq = platform_get_irq(pdev, 0);
 	if (hw->irq < 0) {
-		dev_err(&pdev->dev, "No IRQ specified\n");
 		err = -ENOENT;
 		goto err_no_pdata;
 	}
drivers/spi/spi-sh-msiof.c +0 -1
index b50bdbc27e58..f73f811c9ba7 100644
@@ -1346,7 +1346,6 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
 
 	i = platform_get_irq(pdev, 0);
 	if (i < 0) {
-		dev_err(&pdev->dev, "cannot get IRQ\n");
 		ret = i;
 		goto err1;
 	}
drivers/spi/spi-sh.c +1 -3
index f1ee58208216..20bdae5fdf3b 100644
@@ -437,10 +437,8 @@ static int spi_sh_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "platform_get_irq error: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	master = spi_alloc_master(&pdev->dev, sizeof(struct spi_sh_data));
 	if (master == NULL) {
drivers/spi/spi-sifive.c +0 -1
index 93ec2c6cdbfd..5bf2b57e6929 100644
@@ -323,7 +323,6 @@ static int sifive_spi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "Unable to find interrupt\n");
 		ret = irq;
 		goto put_master;
 	}
drivers/spi/spi-slave-mt27xx.c +0 -1
index d1075433f6a6..61bc43b0fe57 100644
@@ -410,7 +410,6 @@ static int mtk_spi_slave_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get irq (%d)\n", irq);
 		ret = irq;
 		goto err_put_ctlr;
 	}
drivers/spi/spi-sprd.c +1 -3
index 1b7eebb72c07..8c9021b7f7a9 100644
@@ -843,10 +843,8 @@ static int sprd_spi_irq_init(struct platform_device *pdev, struct sprd_spi *ss)
 	int ret;
 
 	ss->irq = platform_get_irq(pdev, 0);
-	if (ss->irq < 0) {
-		dev_err(&pdev->dev, "failed to get irq resource\n");
+	if (ss->irq < 0)
 		return ss->irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, ss->irq, sprd_spi_handle_irq,
 				0, pdev->name, ss);
drivers/spi/spi-stm32-qspi.c +1 -4
index 655e4afbfb2a..9ac6f9fe13cf 100644
@@ -570,11 +570,8 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		if (irq != -EPROBE_DEFER)
-			dev_err(dev, "IRQ error missing or invalid\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, stm32_qspi_irq, 0,
 			       dev_name(dev), qspi);
drivers/spi/spi-sun4i.c +0 -1
index 5194bc07fd60..92e5c667b6a1 100644
@@ -449,7 +449,6 @@ static int sun4i_spi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "No spi IRQ specified\n");
 		ret = -ENXIO;
 		goto err_free_master;
 	}
drivers/spi/spi-sun6i.c +0 -1
index ee2bdaf5b856..1cf3051bba5e 100644
@@ -456,7 +456,6 @@ static int sun6i_spi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "No spi IRQ specified\n");
 		ret = -ENXIO;
 		goto err_free_master;
 	}
drivers/spi/spi-synquacer.c +0 -2
index f99abd85c50a..ae17c99cce03 100644
@@ -670,7 +670,6 @@ static int synquacer_spi_probe(struct platform_device *pdev)
 
 	rx_irq = platform_get_irq(pdev, 0);
 	if (rx_irq <= 0) {
-		dev_err(&pdev->dev, "get rx_irq failed (%d)\n", rx_irq);
 		ret = rx_irq;
 		goto put_spi;
 	}
@@ -685,7 +684,6 @@ static int synquacer_spi_probe(struct platform_device *pdev)
 
 	tx_irq = platform_get_irq(pdev, 1);
 	if (tx_irq <= 0) {
-		dev_err(&pdev->dev, "get tx_irq failed (%d)\n", tx_irq);
 		ret = tx_irq;
 		goto put_spi;
 	}
drivers/spi/spi-ti-qspi.c +0 -1
index 6ca600702470..3cb65371ae3b 100644
@@ -717,7 +717,6 @@ static int ti_qspi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq resource?\n");
 		ret = irq;
 		goto free_master;
 	}
drivers/spi/spi-uniphier.c +0 -1
index b32c77df5d49..c1e6f3245557 100644
@@ -454,7 +454,6 @@ static int uniphier_spi_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get IRQ\n");
 		ret = irq;
 		goto out_disable_clk;
 	}
drivers/spi/spi-xlp.c +1 -3
index 1dc479fab98c..4eb5bc9250fc 100644
@@ -384,10 +384,8 @@ static int xlp_spi_probe(struct platform_device *pdev)
 		return PTR_ERR(xspi->base);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no IRQ resource found: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 	err = devm_request_irq(&pdev->dev, irq, xlp_spi_interrupt, 0,
 			pdev->name, xspi);
 	if (err) {
drivers/spi/spi-zynq-qspi.c +0 -1
index c6bee67decb5..3155e2cabb1e 100644
@@ -671,7 +671,6 @@ static int zynq_qspi_probe(struct platform_device *pdev)
 	xqspi->irq = platform_get_irq(pdev, 0);
 	if (xqspi->irq <= 0) {
 		ret = -ENXIO;
-		dev_err(&pdev->dev, "irq resource not found\n");
 		goto remove_master;
 	}
 	ret = devm_request_irq(&pdev->dev, xqspi->irq, zynq_qspi_irq,
drivers/spi/spi-zynqmp-gqspi.c +0 -1
index 07a83ca164c2..5e9ea8a38163 100644
@@ -1077,7 +1077,6 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
 	xqspi->irq = platform_get_irq(pdev, 0);
 	if (xqspi->irq <= 0) {
 		ret = -ENXIO;
-		dev_err(dev, "irq resource not found\n");
 		goto clk_dis_all;
 	}
 	ret = devm_request_irq(&pdev->dev, xqspi->irq, zynqmp_qspi_irq,
Signature · 1 line
2.20.1
#100 lore raw

Re: [PATCH v6 41/57] spi: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

Hi Stephen,

Quoted 72 lines · Stephen Boyd

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 \) )
{
(

(quoted diff) +0 -4
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }

|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one statement (manually).

---

Please apply directly to subsystem trees

 drivers/spi/atmel-quadspi.c     |  1 -
 drivers/spi/spi-armada-3700.c   |  1 -
 drivers/spi/spi-bcm2835.c       |  1 -
 drivers/spi/spi-bcm2835aux.c    |  1 -
 drivers/spi/spi-bcm63xx-hsspi.c |  4 +---
 drivers/spi/spi-bcm63xx.c       |  4 +---
 drivers/spi/spi-cadence.c       |  1 -
 drivers/spi/spi-dw-mmio.c       |  4 +---
 drivers/spi/spi-efm32.c         |  4 +---
 drivers/spi/spi-ep93xx.c        |  4 +---
 drivers/spi/spi-fsl-dspi.c      |  1 -
 drivers/spi/spi-fsl-qspi.c      |  4 +---
 drivers/spi/spi-geni-qcom.c     |  4 +---
 drivers/spi/spi-lantiq-ssc.c    | 12 +++---------
 drivers/spi/spi-mt65xx.c        |  1 -
 drivers/spi/spi-npcm-pspi.c     |  1 -
 drivers/spi/spi-nuc900.c        |  1 -
 drivers/spi/spi-nxp-fspi.c      |  4 +---
 drivers/spi/spi-pic32-sqi.c     |  1 -
 drivers/spi/spi-pic32.c         | 12 +++---------
 drivers/spi/spi-qcom-qspi.c     |  4 +---
 drivers/spi/spi-s3c24xx.c       |  1 -
 drivers/spi/spi-sh-msiof.c      |  1 -
 drivers/spi/spi-sh.c            |  4 +---
 drivers/spi/spi-sifive.c        |  1 -
 drivers/spi/spi-slave-mt27xx.c  |  1 -
 drivers/spi/spi-sprd.c          |  4 +---
 drivers/spi/spi-stm32-qspi.c    |  5 +----
 drivers/spi/spi-sun4i.c         |  1 -
Quoted 8 lines
 drivers/spi/spi-sun6i.c         |  1 -
 drivers/spi/spi-synquacer.c     |  2 --
 drivers/spi/spi-ti-qspi.c       |  1 -
 drivers/spi/spi-uniphier.c      |  1 -
 drivers/spi/spi-xlp.c           |  4 +---
 drivers/spi/spi-zynq-qspi.c     |  1 -
 drivers/spi/spi-zynqmp-gqspi.c  |  1 -
 36 files changed, 19 insertions(+), 80 deletions(-)

Failed to catch
drivers/spi/spi-rspi.c: ret = platform_get_irq_byname(pdev, "rx"); drivers/spi/spi-rspi.c- if (ret < 0) {
drivers/spi/spi-rspi.c: ret = platform_get_irq_byname(pdev, "mux");
drivers/spi/spi-rspi.c- if (ret < 0)
drivers/spi/spi-rspi.c: ret = platform_get_irq(pdev, 0);
drivers/spi/spi-rspi.c- if (ret >= 0)
drivers/spi/spi-rspi.c- rspi->rx_irq = rspi->tx_irq = ret;
drivers/spi/spi-rspi.c- } else {

drivers/spi/spi-rspi.c-         rspi->rx_irq = ret;
drivers/spi/spi-rspi.c:         ret = platform_get_irq_byname(pdev, "tx");
drivers/spi/spi-rspi.c-         if (ret >= 0)

drivers/spi/spi-rspi.c- rspi->tx_irq = ret;
drivers/spi/spi-rspi.c- }
drivers/spi/spi-rspi.c- if (ret < 0) {
drivers/spi/spi-rspi.c: dev_err(&pdev->dev, "platform_get_irq error\n");
drivers/spi/spi-rspi.c- goto error2;
drivers/spi/spi-rspi.c- }

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#101 lore raw

PATCH v6 42/57 staging: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Greg Kroah-Hartman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/staging/emxx_udc/emxx_udc.c                          | 4 +---
 drivers/staging/goldfish/goldfish_audio.c                    | 4 +---
 drivers/staging/media/allegro-dvt/allegro-core.c             | 4 +---
 drivers/staging/media/hantro/hantro_drv.c                    | 4 +---
 drivers/staging/media/imx/imx7-media-csi.c                   | 4 +---
 drivers/staging/media/imx/imx7-mipi-csis.c                   | 4 +---
 drivers/staging/media/meson/vdec/esparser.c                  | 4 +---
 drivers/staging/media/omap4iss/iss.c                         | 1 -
 drivers/staging/media/sunxi/cedrus/cedrus_hw.c               | 5 +----
 drivers/staging/most/dim2/dim2.c                             | 2 --
 drivers/staging/mt7621-dma/mtk-hsdma.c                       | 4 +---
 drivers/staging/nvec/nvec.c                                  | 4 +---
 drivers/staging/ralink-gdma/ralink-gdma.c                    | 4 +---
 .../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c       | 4 +---
 14 files changed, 12 insertions(+), 40 deletions(-)
drivers/staging/emxx_udc/emxx_udc.c +1 -3
index 4f3c2c13a225..489cde4e915e 100644
@@ -3094,10 +3094,8 @@ static int nbu2ss_drv_probe(struct platform_device *pdev)
 		return PTR_ERR(mmio_base);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get IRQ\n");
+	if (irq < 0)
 		return irq;
-	}
 	status = devm_request_irq(&pdev->dev, irq, _nbu2ss_udc_irq,
 				  0, driver_name, udc);
 
drivers/staging/goldfish/goldfish_audio.c +1 -3
index 24a738238f9f..0c65a0121dde 100644
@@ -302,10 +302,8 @@ static int goldfish_audio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	data->irq = platform_get_irq(pdev, 0);
-	if (data->irq < 0) {
-		dev_err(&pdev->dev, "platform_get_irq failed\n");
+	if (data->irq < 0)
 		return -ENODEV;
-	}
 	data->buffer_virt = dmam_alloc_coherent(&pdev->dev,
 						COMBINED_BUFFER_SIZE,
 						&buf_addr, GFP_KERNEL);
drivers/staging/media/allegro-dvt/allegro-core.c +1 -3
index f050c7347fd5..6f0cd0784786 100644
@@ -2947,10 +2947,8 @@ static int allegro_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get irq resource\n");
+	if (irq < 0)
 		return irq;
-	}
 	ret = devm_request_threaded_irq(&pdev->dev, irq,
 					allegro_hardirq,
 					allegro_irq_thread,
drivers/staging/media/hantro/hantro_drv.c +1 -3
index c3665f0e87a2..4a7afad2af92 100644
@@ -733,10 +733,8 @@ static int hantro_probe(struct platform_device *pdev)
 			continue;
 
 		irq = platform_get_irq_byname(vpu->pdev, irq_name);
-		if (irq <= 0) {
-			dev_err(vpu->dev, "Could not get %s IRQ.\n", irq_name);
+		if (irq <= 0)
 			return -ENXIO;
-		}
 
 		ret = devm_request_irq(vpu->dev, irq,
 				       vpu->variant->irqs[i].handler, 0,
drivers/staging/media/imx/imx7-media-csi.c +1 -3
index 500b4c08d967..d7d38dd9f168 100644
@@ -1194,10 +1194,8 @@ static int imx7_csi_probe(struct platform_device *pdev)
 	}
 
 	csi->irq = platform_get_irq(pdev, 0);
-	if (csi->irq < 0) {
-		dev_err(dev, "Missing platform resources data\n");
+	if (csi->irq < 0)
 		return csi->irq;
-	}
 
 	csi->regbase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(csi->regbase))
drivers/staging/media/imx/imx7-mipi-csis.c +1 -3
index d1cdf011c8f1..73d8354e618c 100644
@@ -975,10 +975,8 @@ static int mipi_csis_probe(struct platform_device *pdev)
 		return PTR_ERR(state->regs);
 
 	state->irq = platform_get_irq(pdev, 0);
-	if (state->irq < 0) {
-		dev_err(dev, "Failed to get irq\n");
+	if (state->irq < 0)
 		return state->irq;
-	}
 
 	ret = mipi_csis_clk_get(state);
 	if (ret < 0)
drivers/staging/media/meson/vdec/esparser.c +1 -3
index 3a21a8cec799..95102a4bdc62 100644
@@ -301,10 +301,8 @@ int esparser_init(struct platform_device *pdev, struct amvdec_core *core)
 	int irq;
 
 	irq = platform_get_irq_byname(pdev, "esparser");
-	if (irq < 0) {
-		dev_err(dev, "Failed getting ESPARSER IRQ from dtb\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, esparser_isr, IRQF_SHARED,
 			       "esparserirq", core);
drivers/staging/media/omap4iss/iss.c +0 -1
index c8be1db532ab..1a966cb2f3a6 100644
@@ -1276,7 +1276,6 @@ static int iss_probe(struct platform_device *pdev)
 	/* Interrupt */
 	ret = platform_get_irq(pdev, 0);
 	if (ret <= 0) {
-		dev_err(iss->dev, "No IRQ resource\n");
 		ret = -ENODEV;
 		goto error_iss;
 	}
drivers/staging/media/sunxi/cedrus/cedrus_hw.c +1 -4
index c34aec7c6e40..9ce3a65903c5 100644
@@ -160,11 +160,8 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
 	dev->capabilities = variant->capabilities;
 
 	irq_dec = platform_get_irq(dev->pdev, 0);
-	if (irq_dec <= 0) {
-		dev_err(dev->dev, "Failed to get IRQ\n");
-
+	if (irq_dec <= 0)
 		return irq_dec;
-	}
 	ret = devm_request_irq(dev->dev, irq_dec, cedrus_irq,
 			       0, dev_name(dev->dev), dev);
 	if (ret) {
drivers/staging/most/dim2/dim2.c +0 -2
index 31fbc1a75b06..c8bec3c34c2c 100644
@@ -797,7 +797,6 @@ static int dim2_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, AHB0_INT_IDX);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get ahb0_int irq: %d\n", irq);
 		ret = irq;
 		goto err_shutdown_dim;
 	}
@@ -811,7 +810,6 @@ static int dim2_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, MLB_INT_IDX);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get mlb_int irq: %d\n", irq);
 		ret = irq;
 		goto err_shutdown_dim;
 	}
drivers/staging/mt7621-dma/mtk-hsdma.c +1 -3
index 60db06768c8a..d964642d95a3 100644
@@ -675,10 +675,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
 	tasklet_init(&hsdma->task, mtk_hsdma_tasklet, (unsigned long)hsdma);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get irq\n");
+	if (irq < 0)
 		return -EINVAL;
-	}
 	ret = devm_request_irq(&pdev->dev, irq, mtk_hsdma_irq,
 			       0, dev_name(&pdev->dev), hsdma);
 	if (ret) {
drivers/staging/nvec/nvec.c +1 -3
index 08027a36e0bc..1cbd7b71fc38 100644
@@ -796,10 +796,8 @@ static int tegra_nvec_probe(struct platform_device *pdev)
 		return PTR_ERR(base);
 
 	nvec->irq = platform_get_irq(pdev, 0);
-	if (nvec->irq < 0) {
-		dev_err(dev, "no irq resource?\n");
+	if (nvec->irq < 0)
 		return -ENODEV;
-	}
 
 	i2c_clk = devm_clk_get(dev, "div-clk");
 	if (IS_ERR(i2c_clk)) {
drivers/staging/ralink-gdma/ralink-gdma.c +1 -3
index 5854551d0a52..900424db9b97 100644
@@ -826,10 +826,8 @@ static int gdma_dma_probe(struct platform_device *pdev)
 	tasklet_init(&dma_dev->task, gdma_dma_tasklet, (unsigned long)dma_dev);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get irq\n");
+	if (irq < 0)
 		return -EINVAL;
-	}
 	ret = devm_request_irq(&pdev->dev, irq, gdma_dma_irq,
 			       0, dev_name(&pdev->dev), dma_dev);
 	if (ret) {
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +1 -3
index 61c69f353cdb..8dc730cfe7a6 100644
@@ -141,10 +141,8 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
 		return PTR_ERR(g_regs);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		dev_err(dev, "failed to get IRQ\n");
+	if (irq <= 0)
 		return irq;
-	}
 
 	err = devm_request_irq(dev, irq, vchiq_doorbell_irq, IRQF_IRQPOLL,
 			       "VCHIQ doorbell", state);
Signature · 1 line
Sent by a computer through tubes
#102 lore raw

PATCH v6 43/57 thermal: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Zhang Rui <[email protected]>
Cc Eduardo Valentin <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/thermal/broadcom/brcmstb_thermal.c  | 4 +---
 drivers/thermal/da9062-thermal.c            | 4 +---
 drivers/thermal/db8500_thermal.c            | 2 --
 drivers/thermal/rockchip_thermal.c          | 4 +---
 drivers/thermal/st/st_thermal_memmap.c      | 4 +---
 drivers/thermal/st/stm_thermal.c            | 4 +---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c | 4 +---
 7 files changed, 6 insertions(+), 20 deletions(-)
drivers/thermal/broadcom/brcmstb_thermal.c +1 -3
index 5825ac581f56..619ad86dbdbc 100644
@@ -331,10 +331,8 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
 	priv->thermal = thermal;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "could not get IRQ\n");
+	if (irq < 0)
 		return irq;
-	}
 	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 					brcmstb_tmon_irq_thread, IRQF_ONESHOT,
 					DRV_NAME, priv);
drivers/thermal/da9062-thermal.c +1 -3
index c32709badeda..2917b1cee1e9 100644
@@ -254,10 +254,8 @@ static int da9062_thermal_probe(struct platform_device *pdev)
 		thermal->zone->passive_delay);
 
 	ret = platform_get_irq_byname(pdev, "THERMAL");
-	if (ret < 0) {
-		dev_err(&pdev->dev, "Failed to get platform IRQ.\n");
+	if (ret < 0)
 		goto err_zone;
-	}
 	thermal->irq = ret;
 
 	ret = request_threaded_irq(thermal->irq, NULL,
drivers/thermal/db8500_thermal.c +0 -2
index b71a999d17d6..e391b5687147 100644
@@ -408,7 +408,6 @@ static int db8500_thermal_probe(struct platform_device *pdev)
 
 	low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW");
 	if (low_irq < 0) {
-		dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n");
 		ret = low_irq;
 		goto out_unlock;
 	}
@@ -423,7 +422,6 @@ static int db8500_thermal_probe(struct platform_device *pdev)
 
 	high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH");
 	if (high_irq < 0) {
-		dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n");
 		ret = high_irq;
 		goto out_unlock;
 	}
drivers/thermal/rockchip_thermal.c +1 -3
index 343c2f5c5a25..00169e5a719a 100644
@@ -1229,10 +1229,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 		return -ENXIO;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq resource?\n");
+	if (irq < 0)
 		return -EINVAL;
-	}
 
 	thermal = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_thermal_data),
 			       GFP_KERNEL);
drivers/thermal/st/st_thermal_memmap.c +1 -3
index a824b78dabf8..a0114452d11f 100644
@@ -94,10 +94,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor)
 	int ret;
 
 	sensor->irq = platform_get_irq(pdev, 0);
-	if (sensor->irq < 0) {
-		dev_err(dev, "failed to register IRQ\n");
+	if (sensor->irq < 0)
 		return sensor->irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, sensor->irq,
 					NULL, st_mmap_thermal_trip_handler,
drivers/thermal/st/stm_thermal.c +1 -3
index cf9ddc52f30e..4697849de1ca 100644
@@ -487,10 +487,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
 	int ret;
 
 	sensor->irq = platform_get_irq(pdev, 0);
-	if (sensor->irq < 0) {
-		dev_err(dev, "%s: Unable to find IRQ\n", __func__);
+	if (sensor->irq < 0)
 		return sensor->irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, sensor->irq,
 					stm_thermal_alarm_irq,
drivers/thermal/ti-soc-thermal/ti-bandgap.c +1 -3
index 2fa78f738568..1747dcaba365 100644
@@ -787,10 +787,8 @@ static int ti_bandgap_talert_init(struct ti_bandgap *bgp,
 	int ret;
 
 	bgp->irq = platform_get_irq(pdev, 0);
-	if (bgp->irq < 0) {
-		dev_err(&pdev->dev, "get_irq failed\n");
+	if (bgp->irq < 0)
 		return bgp->irq;
-	}
 	ret = request_threaded_irq(bgp->irq, NULL,
 				   ti_bandgap_talert_irq_handler,
 				   IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
Signature · 1 line
Sent by a computer through tubes
#103 lore raw

PATCH v6 44/57 tty: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Greg Kroah-Hartman <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/tty/serial/8250/8250_bcm2835aux.c |  4 +---
 drivers/tty/serial/8250/8250_lpc18xx.c    |  4 +---
 drivers/tty/serial/8250/8250_uniphier.c   |  4 +---
 drivers/tty/serial/amba-pl011.c           |  5 +----
 drivers/tty/serial/fsl_lpuart.c           |  4 +---
 drivers/tty/serial/lpc32xx_hs.c           |  5 +----
 drivers/tty/serial/mvebu-uart.c           | 12 +++---------
 drivers/tty/serial/owl-uart.c             |  4 +---
 drivers/tty/serial/qcom_geni_serial.c     |  4 +---
 drivers/tty/serial/rda-uart.c             |  4 +---
 drivers/tty/serial/sccnxp.c               |  1 -
 drivers/tty/serial/serial-tegra.c         |  4 +---
 drivers/tty/serial/sifive.c               |  4 +---
 drivers/tty/serial/sprd_serial.c          |  4 +---
 drivers/tty/serial/stm32-usart.c          | 17 ++++-------------
 15 files changed, 19 insertions(+), 61 deletions(-)
drivers/tty/serial/8250/8250_bcm2835aux.c +1 -3
index bd53661103eb..8ce700c1a7fc 100644
@@ -56,10 +56,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
 
 	/* get the interrupt */
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "irq not found - %i", ret);
+	if (ret < 0)
 		return ret;
-	}
 	data->uart.port.irq = ret;
 
 	/* map the main registers */
drivers/tty/serial/8250/8250_lpc18xx.c +1 -3
index eddf119374e1..570e25d6f37e 100644
@@ -106,10 +106,8 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
 	int irq, ret;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "irq not found");
+	if (irq < 0)
 		return irq;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
drivers/tty/serial/8250/8250_uniphier.c +1 -3
index 164ba133437a..e0b73a5402db 100644
@@ -176,10 +176,8 @@ static int uniphier_uart_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "failed to get IRQ number\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
drivers/tty/serial/amba-pl011.c +1 -4
index 5921a33b2a07..3a7d1a66f79c 100644
@@ -2718,11 +2718,8 @@ static int sbsa_uart_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "cannot obtain irq\n");
+	if (ret < 0)
 		return ret;
-	}
 	uap->port.irq	= ret;
 
 #ifdef CONFIG_ACPI_SPCR_TABLE
drivers/tty/serial/fsl_lpuart.c +1 -3
index 92dad2b4ec36..1b790cc1c0cf 100644
@@ -2346,10 +2346,8 @@ static int lpuart_probe(struct platform_device *pdev)
 	sport->port.type = PORT_LPUART;
 	sport->devtype = sdata->devtype;
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "cannot obtain irq\n");
+	if (ret < 0)
 		return ret;
-	}
 	sport->port.irq = ret;
 	sport->port.iotype = sdata->iotype;
 	if (lpuart_is_32(sport))
drivers/tty/serial/lpc32xx_hs.c +1 -4
index f4e27d0ad947..7c67e3afbac7 100644
@@ -687,11 +687,8 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev)
 	p->port.membase = NULL;
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "Error getting irq for HS UART port %d\n",
-			uarts_registered);
+	if (ret < 0)
 		return ret;
-	}
 	p->port.irq = ret;
 
 	p->port.iotype = UPIO_MEM32;
drivers/tty/serial/mvebu-uart.c +3 -9
index 7e7b1559fa36..c12a12556339 100644
@@ -884,10 +884,8 @@ static int mvebu_uart_probe(struct platform_device *pdev)
 	if (platform_irq_count(pdev) == 1) {
 		/* Old bindings: no name on the single unamed UART0 IRQ */
 		irq = platform_get_irq(pdev, 0);
-		if (irq < 0) {
-			dev_err(&pdev->dev, "unable to get UART IRQ\n");
+		if (irq < 0)
 			return irq;
-		}
 
 		mvuart->irq[UART_IRQ_SUM] = irq;
 	} else {
@@ -897,18 +895,14 @@ static int mvebu_uart_probe(struct platform_device *pdev)
 		 * uart-sum of UART0 port.
 		 */
 		irq = platform_get_irq_byname(pdev, "uart-rx");
-		if (irq < 0) {
-			dev_err(&pdev->dev, "unable to get 'uart-rx' IRQ\n");
+		if (irq < 0)
 			return irq;
-		}
 
 		mvuart->irq[UART_RX_IRQ] = irq;
 
 		irq = platform_get_irq_byname(pdev, "uart-tx");
-		if (irq < 0) {
-			dev_err(&pdev->dev, "unable to get 'uart-tx' IRQ\n");
+		if (irq < 0)
 			return irq;
-		}
 
 		mvuart->irq[UART_TX_IRQ] = irq;
 	}
drivers/tty/serial/owl-uart.c +1 -3
index 29a6dc6a8d23..03963af77b15 100644
@@ -662,10 +662,8 @@ static int owl_uart_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "could not get irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	if (owl_uart_ports[pdev->id]) {
 		dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
drivers/tty/serial/qcom_geni_serial.c +1 -3
index 35e5f9c5d5be..f879710e23f1 100644
@@ -1291,10 +1291,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
 	port->tx_fifo_width = DEF_FIFO_WIDTH_BITS;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Failed to get IRQ %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 	uport->irq = irq;
 
 	uport->private_data = drv;
drivers/tty/serial/rda-uart.c +1 -3
index 284623eefaeb..c1b0d7662ef9 100644
@@ -735,10 +735,8 @@ static int rda_uart_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "could not get irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	if (rda_uart_ports[pdev->id]) {
 		dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
drivers/tty/serial/sccnxp.c +0 -1
index 68a24a14f6b7..d2b77aae42ae 100644
@@ -961,7 +961,6 @@ static int sccnxp_probe(struct platform_device *pdev)
 	if (!s->poll) {
 		s->irq = platform_get_irq(pdev, 0);
 		if (s->irq < 0) {
-			dev_err(&pdev->dev, "Missing irq resource data\n");
 			ret = -ENXIO;
 			goto err_out;
 		}
drivers/tty/serial/serial-tegra.c +1 -3
index d5269aaaf9b2..76ffbc7826ae 100644
@@ -1307,10 +1307,8 @@ static int tegra_uart_probe(struct platform_device *pdev)
 
 	u->iotype = UPIO_MEM32;
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "Couldn't get IRQ\n");
+	if (ret < 0)
 		return ret;
-	}
 	u->irq = ret;
 	u->regshift = 2;
 	ret = uart_add_one_port(&tegra_uart_driver, u);
drivers/tty/serial/sifive.c +1 -3
index be4687814353..d5f81b98e4d7 100644
@@ -896,10 +896,8 @@ static int sifive_serial_probe(struct platform_device *pdev)
 	int irq, id, r;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "could not acquire interrupt\n");
+	if (irq < 0)
 		return -EPROBE_DEFER;
-	}
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(&pdev->dev, mem);
drivers/tty/serial/sprd_serial.c +1 -3
index 73d71a4e6c0c..284709f61831 100644
@@ -1173,10 +1173,8 @@ static int sprd_probe(struct platform_device *pdev)
 	up->mapbase = res->start;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "not provide irq resource: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 	up->irq = irq;
 
 	/*
drivers/tty/serial/stm32-usart.c +4 -13
index 24a2261f879a..222694352a17 100644
@@ -927,11 +927,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
 	port->fifosize	= stm32port->info->cfg.fifosize;
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret <= 0) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Can't get event IRQ: %d\n", ret);
-		return ret ? ret : -ENODEV;
-	}
+	if (ret <= 0)
+		return ret ? : -ENODEV;
 	port->irq = ret;
 
 	port->rs485_config = stm32_config_rs485;
@@ -940,14 +937,8 @@ static int stm32_init_port(struct stm32_port *stm32port,
 
 	if (stm32port->info->cfg.has_wakeup) {
 		stm32port->wakeirq = platform_get_irq(pdev, 1);
-		if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO) {
-			if (stm32port->wakeirq != -EPROBE_DEFER)
-				dev_err(&pdev->dev,
-					"Can't get event wake IRQ: %d\n",
-					stm32port->wakeirq);
-			return stm32port->wakeirq ? stm32port->wakeirq :
-				-ENODEV;
-		}
+		if (stm32port->wakeirq <= 0 && stm32port->wakeirq != -ENXIO)
+			return stm32port->wakeirq ? : -ENODEV;
 	}
 
 	stm32port->fifoen = stm32port->info->cfg.has_fifo;
Signature · 1 line
Sent by a computer through tubes
#104 lore raw

PATCH v6 45/57 uio: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Greg Kroah-Hartman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/uio/uio_dmem_genirq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/uio/uio_dmem_genirq.c +1 -3
index f32cef94aa82..ebcf1434e296 100644
@@ -200,10 +200,8 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
 
 	if (!uioinfo->irq) {
 		ret = platform_get_irq(pdev, 0);
-		if (ret < 0) {
-			dev_err(&pdev->dev, "failed to get IRQ\n");
+		if (ret < 0)
 			goto bad1;
-		}
 		uioinfo->irq = ret;
 	}
 	uiomem = &uioinfo->mem[0];
Signature · 1 line
Sent by a computer through tubes
#105 lore raw

PATCH v6 46/57 usb: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Greg Kroah-Hartman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/usb/chipidea/core.c               |  1 -
 drivers/usb/dwc2/platform.c               |  4 +---
 drivers/usb/dwc3/dwc3-keystone.c          |  1 -
 drivers/usb/dwc3/dwc3-omap.c              |  4 +---
 drivers/usb/gadget/udc/aspeed-vhub/core.c |  1 -
 drivers/usb/gadget/udc/bcm63xx_udc.c      |  8 ++------
 drivers/usb/gadget/udc/bdc/bdc_core.c     |  4 +---
 drivers/usb/gadget/udc/gr_udc.c           |  8 ++------
 drivers/usb/gadget/udc/lpc32xx_udc.c      |  5 +----
 drivers/usb/gadget/udc/renesas_usb3.c     |  4 +---
 drivers/usb/gadget/udc/s3c-hsudc.c        |  4 +---
 drivers/usb/gadget/udc/udc-xilinx.c       |  4 +---
 drivers/usb/host/ehci-atmel.c             |  3 ---
 drivers/usb/host/ehci-omap.c              |  4 +---
 drivers/usb/host/ehci-orion.c             |  3 ---
 drivers/usb/host/ehci-platform.c          |  4 +---
 drivers/usb/host/ehci-sh.c                |  3 ---
 drivers/usb/host/ehci-st.c                |  4 +---
 drivers/usb/host/imx21-hcd.c              |  4 +---
 drivers/usb/host/ohci-platform.c          |  4 +---
 drivers/usb/host/ohci-st.c                |  4 +---
 drivers/usb/mtu3/mtu3_core.c              |  4 +---
 drivers/usb/phy/phy-ab8500-usb.c          | 12 +++---------
 drivers/usb/typec/tcpm/wcove.c            |  4 +---
 24 files changed, 22 insertions(+), 79 deletions(-)
drivers/usb/chipidea/core.c +0 -1
index 26062d610c20..36c964cd40a3 100644
@@ -1008,7 +1008,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
 
 	ci->irq = platform_get_irq(pdev, 0);
 	if (ci->irq < 0) {
-		dev_err(dev, "missing IRQ\n");
 		ret = ci->irq;
 		goto deinit_phy;
 	}
drivers/usb/dwc2/platform.c +1 -3
index 80fd3c6dcd1c..3c6ce09a6db5 100644
@@ -407,10 +407,8 @@ static int dwc2_driver_probe(struct platform_device *dev)
 	spin_lock_init(&hsotg->lock);
 
 	hsotg->irq = platform_get_irq(dev, 0);
-	if (hsotg->irq < 0) {
-		dev_err(&dev->dev, "missing IRQ resource\n");
+	if (hsotg->irq < 0)
 		return hsotg->irq;
-	}
 
 	dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
 		hsotg->irq);
drivers/usb/dwc3/dwc3-keystone.c +0 -1
index cbee5fb9b9fb..a69eb4a7b832 100644
@@ -112,7 +112,6 @@ static int kdwc3_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "missing irq\n");
 		error = irq;
 		goto err_irq;
 	}
drivers/usb/dwc3/dwc3-omap.c +1 -3
index ed8b86517675..6f711d58d82f 100644
@@ -469,10 +469,8 @@ static int dwc3_omap_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, omap);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "missing IRQ resource: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(dev, res);
drivers/usb/gadget/udc/aspeed-vhub/core.c +0 -1
index db3628be38c0..c08d385e2723 100644
@@ -348,7 +348,6 @@ static int ast_vhub_probe(struct platform_device *pdev)
 	/* Find interrupt and install handler */
 	vhub->irq = platform_get_irq(pdev, 0);
 	if (vhub->irq < 0) {
-		dev_err(&pdev->dev, "Failed to get interrupt\n");
 		rc = vhub->irq;
 		goto err;
 	}
drivers/usb/gadget/udc/bcm63xx_udc.c +2 -6
index c1fcc77403ea..97b16463f3ef 100644
@@ -2328,10 +2328,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
 
 	/* IRQ resource #0: control interrupt (VBUS, speed, etc.) */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "missing IRQ resource #0\n");
+	if (irq < 0)
 		goto out_uninit;
-	}
 	if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0,
 			     dev_name(dev), udc) < 0)
 		goto report_request_failure;
@@ -2339,10 +2337,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
 	/* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */
 	for (i = 0; i < BCM63XX_NUM_IUDMA; i++) {
 		irq = platform_get_irq(pdev, i + 1);
-		if (irq < 0) {
-			dev_err(dev, "missing IRQ resource #%d\n", i + 1);
+		if (irq < 0)
 			goto out_uninit;
-		}
 		if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0,
 				     dev_name(dev), &udc->iudma[i]) < 0)
 			goto report_request_failure;
drivers/usb/gadget/udc/bdc/bdc_core.c +1 -3
index ccbd1d34eb2a..cc4a16e253ac 100644
@@ -515,10 +515,8 @@ static int bdc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "platform_get_irq failed:%d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 	spin_lock_init(&bdc->lock);
 	platform_set_drvdata(pdev, bdc);
 	bdc->irq = irq;
drivers/usb/gadget/udc/gr_udc.c +2 -6
index 729e60e49564..7a0e9a58c2d8 100644
@@ -2134,19 +2134,15 @@ static int gr_probe(struct platform_device *pdev)
 		return PTR_ERR(regs);
 
 	dev->irq = platform_get_irq(pdev, 0);
-	if (dev->irq <= 0) {
-		dev_err(dev->dev, "No irq found\n");
+	if (dev->irq <= 0)
 		return -ENODEV;
-	}
 
 	/* Some core configurations has separate irqs for IN and OUT events */
 	dev->irqi = platform_get_irq(pdev, 1);
 	if (dev->irqi > 0) {
 		dev->irqo = platform_get_irq(pdev, 2);
-		if (dev->irqo <= 0) {
-			dev_err(dev->dev, "Found irqi but not irqo\n");
+		if (dev->irqo <= 0)
 			return -ENODEV;
-		}
 	} else {
 		dev->irqi = 0;
 	}
drivers/usb/gadget/udc/lpc32xx_udc.c +1 -4
index 5f1b14f3e5a0..e9cf20979bf6 100644
@@ -3061,11 +3061,8 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
 	/* Get IRQs */
 	for (i = 0; i < 4; i++) {
 		udc->udp_irq[i] = platform_get_irq(pdev, i);
-		if (udc->udp_irq[i] < 0) {
-			dev_err(udc->dev,
-				"irq resource %d not available!\n", i);
+		if (udc->udp_irq[i] < 0)
 			return udc->udp_irq[i];
-		}
 	}
 
 	udc->udp_baseaddr = devm_ioremap_resource(dev, res);
drivers/usb/gadget/udc/renesas_usb3.c +1 -3
index 87062d22134d..027a25694a68 100644
@@ -2743,10 +2743,8 @@ static int renesas_usb3_probe(struct platform_device *pdev)
 		priv = of_device_get_match_data(&pdev->dev);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	usb3 = devm_kzalloc(&pdev->dev, sizeof(*usb3), GFP_KERNEL);
 	if (!usb3)
drivers/usb/gadget/udc/s3c-hsudc.c +1 -3
index 31c7c5587cf9..858993c73442 100644
@@ -1311,10 +1311,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
 	s3c_hsudc_setup_ep(hsudc);
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(dev, "unable to obtain IRQ number\n");
+	if (ret < 0)
 		goto err_res;
-	}
 	hsudc->irq = ret;
 
 	ret = devm_request_irq(&pdev->dev, hsudc->irq, s3c_hsudc_irq, 0,
drivers/usb/gadget/udc/udc-xilinx.c +1 -3
index b1f4104d1283..29d8e5f8bb58 100644
@@ -2074,10 +2074,8 @@ static int xudc_probe(struct platform_device *pdev)
 		return PTR_ERR(udc->addr);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "unable to get irq\n");
+	if (irq < 0)
 		return irq;
-	}
 	ret = devm_request_irq(&pdev->dev, irq, xudc_irq, 0,
 			       dev_name(&pdev->dev), udc);
 	if (ret < 0) {
drivers/usb/host/ehci-atmel.c +0 -3
index 3ba140ceaf52..e893467d659c 100644
@@ -100,9 +100,6 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
-		dev_err(&pdev->dev,
-			"Found HC with no IRQ. Check %s setup!\n",
-			dev_name(&pdev->dev));
 		retval = -ENODEV;
 		goto fail_create_hcd;
 	}
drivers/usb/host/ehci-omap.c +1 -3
index 7d20296cbe9f..fc125b3d06e7 100644
@@ -115,10 +115,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "EHCI irq failed: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	res =  platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	regs = devm_ioremap_resource(dev, res);
drivers/usb/host/ehci-orion.c +0 -3
index 790acf3633e8..a319b1df3011 100644
@@ -223,9 +223,6 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
-		dev_err(&pdev->dev,
-			"Found HC with no IRQ. Check %s setup!\n",
-			dev_name(&pdev->dev));
 		err = -ENODEV;
 		goto err;
 	}
drivers/usb/host/ehci-platform.c +1 -3
index 4c306fb6b069..769749ca5961 100644
@@ -145,10 +145,8 @@ static int ehci_platform_probe(struct platform_device *dev)
 	}
 
 	irq = platform_get_irq(dev, 0);
-	if (irq < 0) {
-		dev_err(&dev->dev, "no irq provided");
+	if (irq < 0)
 		return irq;
-	}
 
 	hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev,
 			     dev_name(&dev->dev));
drivers/usb/host/ehci-sh.c +0 -3
index a9ee767952c1..ef75b9d70eb4 100644
@@ -85,9 +85,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq <= 0) {
-		dev_err(&pdev->dev,
-			"Found HC with no IRQ. Check %s setup!\n",
-			dev_name(&pdev->dev));
 		ret = -ENODEV;
 		goto fail_create_hcd;
 	}
drivers/usb/host/ehci-st.c +1 -3
index ccb4e611001d..f74433aac948 100644
@@ -158,10 +158,8 @@ static int st_ehci_platform_probe(struct platform_device *dev)
 		return -ENODEV;
 
 	irq = platform_get_irq(dev, 0);
-	if (irq < 0) {
-		dev_err(&dev->dev, "no irq provided");
+	if (irq < 0)
 		return irq;
-	}
 	res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	if (!res_mem) {
 		dev_err(&dev->dev, "no memory resource provided");
drivers/usb/host/imx21-hcd.c +1 -3
index 6e3dad19d369..e406c5459a97 100644
@@ -1836,10 +1836,8 @@ static int imx21_probe(struct platform_device *pdev)
 	if (!res)
 		return -ENODEV;
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	hcd = usb_create_hcd(&imx21_hc_driver,
 		&pdev->dev, dev_name(&pdev->dev));
drivers/usb/host/ohci-platform.c +1 -3
index 65a1c3fdc88c..7addfc2cbadc 100644
@@ -111,10 +111,8 @@ static int ohci_platform_probe(struct platform_device *dev)
 		return err;
 
 	irq = platform_get_irq(dev, 0);
-	if (irq < 0) {
-		dev_err(&dev->dev, "no irq provided");
+	if (irq < 0)
 		return irq;
-	}
 
 	hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
 			dev_name(&dev->dev));
drivers/usb/host/ohci-st.c +1 -3
index 638a92bd2cdc..ac796ccd93ef 100644
@@ -138,10 +138,8 @@ static int st_ohci_platform_probe(struct platform_device *dev)
 		return -ENODEV;
 
 	irq = platform_get_irq(dev, 0);
-	if (irq < 0) {
-		dev_err(&dev->dev, "no irq provided");
+	if (irq < 0)
 		return irq;
-	}
 
 	res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	if (!res_mem) {
drivers/usb/mtu3/mtu3_core.c +1 -3
index f8bd1d57e795..c3d5c1206eec 100644
@@ -835,10 +835,8 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
 		return -ENOMEM;
 
 	mtu->irq = platform_get_irq(pdev, 0);
-	if (mtu->irq < 0) {
-		dev_err(dev, "fail to get irq number\n");
+	if (mtu->irq < 0)
 		return mtu->irq;
-	}
 	dev_info(dev, "irq %d\n", mtu->irq);
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac");
drivers/usb/phy/phy-ab8500-usb.c +3 -9
index aaf363f19714..bda3ac2a321e 100644
@@ -712,10 +712,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 
 	if (ab->flags & AB8500_USB_FLAG_USE_LINK_STATUS_IRQ) {
 		irq = platform_get_irq_byname(pdev, "USB_LINK_STATUS");
-		if (irq < 0) {
-			dev_err(&pdev->dev, "Link status irq not found\n");
+		if (irq < 0)
 			return irq;
-		}
 		err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 				ab8500_usb_link_status_irq,
 				IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
@@ -728,10 +726,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 
 	if (ab->flags & AB8500_USB_FLAG_USE_ID_WAKEUP_IRQ) {
 		irq = platform_get_irq_byname(pdev, "ID_WAKEUP_F");
-		if (irq < 0) {
-			dev_err(&pdev->dev, "ID fall irq not found\n");
+		if (irq < 0)
 			return irq;
-		}
 		err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 				ab8500_usb_disconnect_irq,
 				IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
@@ -744,10 +740,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 
 	if (ab->flags & AB8500_USB_FLAG_USE_VBUS_DET_IRQ) {
 		irq = platform_get_irq_byname(pdev, "VBUS_DET_F");
-		if (irq < 0) {
-			dev_err(&pdev->dev, "VBUS fall irq not found\n");
+		if (irq < 0)
 			return irq;
-		}
 		err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 				ab8500_usb_disconnect_irq,
 				IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
drivers/usb/typec/tcpm/wcove.c +1 -3
index 6b317c150bdd..edc271da14f4 100644
@@ -617,10 +617,8 @@ static int wcove_typec_probe(struct platform_device *pdev)
 	wcove->regmap = pmic->regmap;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	irq = regmap_irq_get_virq(pmic->irq_chip_data_chgr, irq);
 	if (irq < 0)
Signature · 1 line
Sent by a computer through tubes
Acked-by on v6 46/57
#106 lore raw

Re: [PATCH v6 46/57] usb: Remove dev_err() usage after platform_get_irq()

Hi,

Quoted 43 lines · Stephen Boyd

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 \) )
{
(

(quoted diff) +0 -4
-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 Greg Kroah-Hartman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

Quoted 12 lines
 drivers/usb/chipidea/core.c               |  1 -
 drivers/usb/dwc2/platform.c               |  4 +---
 drivers/usb/dwc3/dwc3-keystone.c          |  1 -
 drivers/usb/dwc3/dwc3-omap.c              |  4 +---
 drivers/usb/gadget/udc/aspeed-vhub/core.c |  1 -
 drivers/usb/gadget/udc/bcm63xx_udc.c      |  8 ++------
 drivers/usb/gadget/udc/bdc/bdc_core.c     |  4 +---
 drivers/usb/gadget/udc/gr_udc.c           |  8 ++------
 drivers/usb/gadget/udc/lpc32xx_udc.c      |  5 +----
 drivers/usb/gadget/udc/renesas_usb3.c     |  4 +---
 drivers/usb/gadget/udc/s3c-hsudc.c        |  4 +---
 drivers/usb/gadget/udc/udc-xilinx.c       |  4 +---

For dwc2, dwc3, gadget and usb/phy:

Signature · 1 line
balbi
#107 lore raw

PATCH v6 47/57 video: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Bartlomiej Zolnierkiewicz <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/video/fbdev/atmel_lcdfb.c     | 1 -
 drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 1 -
 drivers/video/fbdev/nuc900fb.c        | 4 +---
 drivers/video/fbdev/pxa168fb.c        | 4 +---
 drivers/video/fbdev/pxa3xx-gcu.c      | 4 +---
 drivers/video/fbdev/pxafb.c           | 1 -
 drivers/video/fbdev/s3c2410fb.c       | 4 +---
 drivers/video/fbdev/vt8500lcdfb.c     | 1 -
 8 files changed, 4 insertions(+), 16 deletions(-)
drivers/video/fbdev/atmel_lcdfb.c +0 -1
index 5ff8e0320d95..4a16354d65c8 100644
@@ -1114,7 +1114,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
 
 	sinfo->irq_base = platform_get_irq(pdev, 0);
 	if (sinfo->irq_base < 0) {
-		dev_err(dev, "unable to get irq\n");
 		ret = sinfo->irq_base;
 		goto stop_clk;
 	}
drivers/video/fbdev/mmp/hw/mmp_ctrl.c +0 -1
index 17174cd7a5bb..d6124976139b 100644
@@ -447,7 +447,6 @@ static int mmphw_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "%s: no IRQ defined\n", __func__);
 		ret = -ENOENT;
 		goto failed;
 	}
drivers/video/fbdev/nuc900fb.c +1 -3
index 4fd851598584..c4606c734f44 100644
@@ -526,10 +526,8 @@ static int nuc900fb_probe(struct platform_device *pdev)
 	display = mach_info->displays + mach_info->default_display;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for device\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	fbinfo = framebuffer_alloc(sizeof(struct nuc900fb_info), &pdev->dev);
 	if (!fbinfo)
drivers/video/fbdev/pxa168fb.c +1 -3
index 1410f476e135..d9e5258503f0 100644
@@ -625,10 +625,8 @@ static int pxa168fb_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no IRQ defined\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
 	if (info == NULL) {
drivers/video/fbdev/pxa3xx-gcu.c +1 -3
index 74ffb446e00c..07414d43cb3f 100644
@@ -614,10 +614,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 
 	/* request the IRQ */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "no IRQ defined: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,
 			       0, DRV_NAME, priv);
drivers/video/fbdev/pxafb.c +0 -1
index 4282cb117b92..b44f402ce552 100644
@@ -2353,7 +2353,6 @@ static int pxafb_probe(struct platform_device *dev)
 
 	irq = platform_get_irq(dev, 0);
 	if (irq < 0) {
-		dev_err(&dev->dev, "no IRQ defined\n");
 		ret = -ENODEV;
 		goto failed_free_mem;
 	}
drivers/video/fbdev/s3c2410fb.c +1 -3
index a702da89910b..2a846fd5da2a 100644
@@ -849,10 +849,8 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
 	display = mach_info->displays + mach_info->default_display;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for device\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), &pdev->dev);
 	if (!fbinfo)
drivers/video/fbdev/vt8500lcdfb.c +0 -1
index be8d9702cbb2..a10088e1cdb0 100644
@@ -372,7 +372,6 @@ static int vt8500lcd_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "no IRQ defined\n");
 		ret = -ENODEV;
 		goto failed_free_palette;
 	}
Signature · 1 line
Sent by a computer through tubes
#108 lore raw

Re: [PATCH v6 47/57] video: Remove dev_err() usage after platform_get_irq()

Hi,

Sorry for the late reply.

Quoted 3 lines · Stephen Boyd

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.

This patch changes handling of -EPROBE_DEFER in the modified drivers (most don't support it and error message will no longer be printed).

I cannot apply it as it is (seems that -EPROBE_DEFER handling should be audited/fixed in the affected drivers first).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 161 lines

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret > (
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(

(quoted diff) +0 -4
-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 Bartlomiej Zolnierkiewicz <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/video/fbdev/atmel_lcdfb.c     | 1 -
 drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 1 -
 drivers/video/fbdev/nuc900fb.c        | 4 +---
 drivers/video/fbdev/pxa168fb.c        | 4 +---
 drivers/video/fbdev/pxa3xx-gcu.c      | 4 +---
 drivers/video/fbdev/pxafb.c           | 1 -
 drivers/video/fbdev/s3c2410fb.c       | 4 +---
 drivers/video/fbdev/vt8500lcdfb.c     | 1 -
 8 files changed, 4 insertions(+), 16 deletions(-)
drivers/video/fbdev/atmel_lcdfb.c +0 -1
index 5ff8e0320d95..4a16354d65c8 100644
@@ -1114,7 +1114,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
 
 	sinfo->irq_base = platform_get_irq(pdev, 0);
 	if (sinfo->irq_base < 0) {
-		dev_err(dev, "unable to get irq\n");
 		ret = sinfo->irq_base;
 		goto stop_clk;
 	}
drivers/video/fbdev/mmp/hw/mmp_ctrl.c +0 -1
index 17174cd7a5bb..d6124976139b 100644
@@ -447,7 +447,6 @@ static int mmphw_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "%s: no IRQ defined\n", __func__);
 		ret = -ENOENT;
 		goto failed;
 	}
drivers/video/fbdev/nuc900fb.c +1 -3
index 4fd851598584..c4606c734f44 100644
@@ -526,10 +526,8 @@ static int nuc900fb_probe(struct platform_device *pdev)
 	display = mach_info->displays + mach_info->default_display;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for device\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	fbinfo = framebuffer_alloc(sizeof(struct nuc900fb_info), &pdev->dev);
 	if (!fbinfo)
drivers/video/fbdev/pxa168fb.c +1 -3
index 1410f476e135..d9e5258503f0 100644
@@ -625,10 +625,8 @@ static int pxa168fb_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no IRQ defined\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
 	if (info = NULL) {
drivers/video/fbdev/pxa3xx-gcu.c +1 -3
index 74ffb446e00c..07414d43cb3f 100644
@@ -614,10 +614,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 
 	/* request the IRQ */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "no IRQ defined: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,
 			       0, DRV_NAME, priv);
drivers/video/fbdev/pxafb.c +0 -1
index 4282cb117b92..b44f402ce552 100644
@@ -2353,7 +2353,6 @@ static int pxafb_probe(struct platform_device *dev)
 
 	irq = platform_get_irq(dev, 0);
 	if (irq < 0) {
-		dev_err(&dev->dev, "no IRQ defined\n");
 		ret = -ENODEV;
 		goto failed_free_mem;
 	}
drivers/video/fbdev/s3c2410fb.c +1 -3
index a702da89910b..2a846fd5da2a 100644
@@ -849,10 +849,8 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
 	display = mach_info->displays + mach_info->default_display;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for device\n");
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), &pdev->dev);
 	if (!fbinfo)
drivers/video/fbdev/vt8500lcdfb.c +0 -1
index be8d9702cbb2..a10088e1cdb0 100644
@@ -372,7 +372,6 @@ static int vt8500lcd_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "no IRQ defined\n");
 		ret = -ENODEV;
 		goto failed_free_palette;
 	}
#109 lore raw

PATCH v6 48/57 watchdog: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Wim Van Sebroeck <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/watchdog/sprd_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/sprd_wdt.c +1 -3
index edba4e278685..0bb17b046140 100644
@@ -284,10 +284,8 @@ static int sprd_wdt_probe(struct platform_device *pdev)
 	}
 
 	wdt->irq = platform_get_irq(pdev, 0);
-	if (wdt->irq < 0) {
-		dev_err(dev, "failed to get IRQ resource\n");
+	if (wdt->irq < 0)
 		return wdt->irq;
-	}
 
 	ret = devm_request_irq(dev, wdt->irq, sprd_wdt_isr, IRQF_NO_SUSPEND,
 			       "sprd-wdt", (void *)wdt);
Signature · 1 line
Sent by a computer through tubes
maintainer Reviewed-by on v6 48/57
#110 lore raw

Re: [PATCH v6 48/57] watchdog: Remove dev_err() usage after platform_get_irq()

Quoted 32 lines · Stephen Boyd

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 \) )
{
(

(quoted diff) +0 -4
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }

|
...
-dev_err(...);
)
...
}
// </smpl>

Quoted 8 lines

While we're here, remove braces on if statements that only have one statement (manually).

Cc Wim Van Sebroeck <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Quoted 26 lines

---

Please apply directly to subsystem trees

 drivers/watchdog/sprd_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/sprd_wdt.c +1 -3
index edba4e278685..0bb17b046140 100644
@@ -284,10 +284,8 @@ static int sprd_wdt_probe(struct platform_device *pdev)
 	}
 
 	wdt->irq = platform_get_irq(pdev, 0);
-	if (wdt->irq < 0) {
-		dev_err(dev, "failed to get IRQ resource\n");
+	if (wdt->irq < 0)
 		return wdt->irq;
-	}
 
 	ret = devm_request_irq(dev, wdt->irq, sprd_wdt_isr, IRQF_NO_SUSPEND,
 			       "sprd-wdt", (void *)wdt);
Signature · 1 line
Sent by a computer through tubes
#111 lore raw

PATCH v6 49/57 ASoC: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 sound/soc/atmel/atmel-classd.c             |  7 ++-----
 sound/soc/atmel/atmel-pdmic.c              |  7 ++-----
 sound/soc/bcm/cygnus-ssp.c                 |  7 ++-----
 sound/soc/codecs/msm8916-wcd-analog.c      | 12 +++---------
 sound/soc/codecs/twl6040.c                 |  4 +---
 sound/soc/fsl/fsl_asrc.c                   |  4 +---
 sound/soc/fsl/fsl_esai.c                   |  4 +---
 sound/soc/fsl/fsl_sai.c                    |  4 +---
 sound/soc/fsl/fsl_spdif.c                  |  4 +---
 sound/soc/fsl/fsl_ssi.c                    |  4 +---
 sound/soc/fsl/imx-ssi.c                    |  4 +---
 sound/soc/kirkwood/kirkwood-i2s.c          |  4 +---
 sound/soc/mediatek/common/mtk-btcvsd.c     |  4 +---
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c |  4 +---
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c |  4 +---
 sound/soc/mxs/mxs-saif.c                   |  8 ++------
 sound/soc/qcom/lpass-platform.c            |  5 +----
 sound/soc/sof/intel/bdw.c                  |  5 +----
 sound/soc/sof/intel/byt.c                  |  5 +----
 sound/soc/sprd/sprd-mcdt.c                 |  4 +---
 sound/soc/sti/sti_uniperif.c               |  4 +---
 sound/soc/stm/stm32_i2s.c                  |  5 +----
 sound/soc/stm/stm32_sai.c                  |  4 +---
 sound/soc/stm/stm32_spdifrx.c              |  4 +---
 sound/soc/sunxi/sun4i-i2s.c                |  4 +---
 sound/soc/uniphier/aio-dma.c               |  4 +---
 sound/soc/xilinx/xlnx_formatter_pcm.c      |  2 --
 sound/soc/xtensa/xtfpga-i2s.c              |  1 -
 28 files changed, 32 insertions(+), 100 deletions(-)
sound/soc/atmel/atmel-classd.c +2 -5
index 0f2c574f27f1..e98601eccfa3 100644
@@ -571,11 +571,8 @@ static int atmel_classd_probe(struct platform_device *pdev)
 	dd->pdata = pdata;
 
 	dd->irq = platform_get_irq(pdev, 0);
-	if (dd->irq < 0) {
-		ret = dd->irq;
-		dev_err(dev, "failed to could not get irq: %d\n", ret);
-		return ret;
-	}
+	if (dd->irq < 0)
+		return dd->irq;
 
 	dd->pclk = devm_clk_get(dev, "pclk");
 	if (IS_ERR(dd->pclk)) {
sound/soc/atmel/atmel-pdmic.c +2 -5
index e09c28349e0d..04ec6f0af179 100644
@@ -612,11 +612,8 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
 	dd->dev = dev;
 
 	dd->irq = platform_get_irq(pdev, 0);
-	if (dd->irq < 0) {
-		ret = dd->irq;
-		dev_err(dev, "failed to get irq: %d\n", ret);
-		return ret;
-	}
+	if (dd->irq < 0)
+		return dd->irq;
 
 	dd->pclk = devm_clk_get(dev, "pclk");
 	if (IS_ERR(dd->pclk)) {
sound/soc/bcm/cygnus-ssp.c +2 -5
index b7c358b48d8d..2f9357d7da96 100644
@@ -1342,11 +1342,8 @@ static int cygnus_ssp_probe(struct platform_device *pdev)
 	}
 
 	cygaud->irq_num = platform_get_irq(pdev, 0);
-	if (cygaud->irq_num <= 0) {
-		dev_err(dev, "platform_get_irq failed\n");
-		err = cygaud->irq_num;
-		return err;
-	}
+	if (cygaud->irq_num <= 0)
+		return cygaud->irq_num;
 
 	err = audio_clk_init(pdev, cygaud);
 	if (err) {
sound/soc/codecs/msm8916-wcd-analog.c +3 -9
index 368b6c09474b..667e9f73aba3 100644
@@ -1185,10 +1185,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq_byname(pdev, "mbhc_switch_int");
-	if (irq < 0) {
-		dev_err(dev, "failed to get mbhc switch irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, irq, NULL,
 			       pm8916_mbhc_switch_irq_handler,
@@ -1200,10 +1198,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
 
 	if (priv->mbhc_btn_enabled) {
 		irq = platform_get_irq_byname(pdev, "mbhc_but_press_det");
-		if (irq < 0) {
-			dev_err(dev, "failed to get button press irq\n");
+		if (irq < 0)
 			return irq;
-		}
 
 		ret = devm_request_threaded_irq(dev, irq, NULL,
 				       mbhc_btn_press_irq_handler,
@@ -1214,10 +1210,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
 			dev_err(dev, "cannot request mbhc button press irq\n");
 
 		irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det");
-		if (irq < 0) {
-			dev_err(dev, "failed to get button release irq\n");
+		if (irq < 0)
 			return irq;
-		}
 
 		ret = devm_request_threaded_irq(dev, irq, NULL,
 				       mbhc_btn_release_irq_handler,
sound/soc/codecs/twl6040.c +1 -3
index 472c2fff34a8..f34637afee51 100644
@@ -1108,10 +1108,8 @@ static int twl6040_probe(struct snd_soc_component *component)
 	priv->component = component;
 
 	priv->plug_irq = platform_get_irq(pdev, 0);
-	if (priv->plug_irq < 0) {
-		dev_err(component->dev, "invalid irq: %d\n", priv->plug_irq);
+	if (priv->plug_irq < 0)
 		return priv->plug_irq;
-	}
 
 	INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work);
 
sound/soc/fsl/fsl_asrc.c +1 -3
index cbbf6257f08a..cfa40ef6b1ca 100644
@@ -885,10 +885,8 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
 			       dev_name(&pdev->dev), asrc_priv);
sound/soc/fsl/fsl_esai.c +1 -3
index 10d2210c91ef..19524ca9b4f1 100644
@@ -824,10 +824,8 @@ static int fsl_esai_probe(struct platform_device *pdev)
 				PTR_ERR(esai_priv->spbaclk));
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
 			       esai_priv->name, esai_priv);
sound/soc/fsl/fsl_sai.c +1 -3
index d58cc3ae90d8..6faf222add2b 100644
@@ -832,10 +832,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
 	if (ret) {
sound/soc/fsl/fsl_spdif.c +1 -3
index 4842e6df9a2d..7858a5499ac5 100644
@@ -1248,10 +1248,8 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
 			       dev_name(&pdev->dev), spdif_priv);
sound/soc/fsl/fsl_ssi.c +1 -3
index fa862af25c1a..b0a6fead1a6a 100644
@@ -1510,10 +1510,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 	}
 
 	ssi->irq = platform_get_irq(pdev, 0);
-	if (ssi->irq < 0) {
-		dev_err(dev, "no irq for node %s\n", pdev->name);
+	if (ssi->irq < 0)
 		return ssi->irq;
-	}
 
 	/* Set software limitations for synchronous mode except AC97 */
 	if (ssi->synchronous && !fsl_ssi_is_ac97(ssi)) {
sound/soc/fsl/imx-ssi.c +1 -3
index 9038b61317be..42031ba7da31 100644
@@ -520,10 +520,8 @@ static int imx_ssi_probe(struct platform_device *pdev)
 	}
 
 	ssi->irq = platform_get_irq(pdev, 0);
-	if (ssi->irq < 0) {
-		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq);
+	if (ssi->irq < 0)
 		return ssi->irq;
-	}
 
 	ssi->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(ssi->clk)) {
sound/soc/kirkwood/kirkwood-i2s.c +1 -3
index 3446a113f482..bf9aa58b31c6 100644
@@ -539,10 +539,8 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->io);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (priv->irq < 0) {
-		dev_err(&pdev->dev, "platform_get_irq failed: %d\n", priv->irq);
+	if (priv->irq < 0)
 		return priv->irq;
-	}
 
 	if (np) {
 		priv->burst = 128;		/* might be 32 or 128 */
sound/soc/mediatek/common/mtk-btcvsd.c +1 -3
index c7a81c4be068..d00608c73c6e 100644
@@ -1335,10 +1335,8 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 
 	/* irq */
 	irq_id = platform_get_irq(pdev, 0);
-	if (irq_id <= 0) {
-		dev_err(dev, "%pOFn no irq found\n", dev->of_node);
+	if (irq_id <= 0)
 		return irq_id < 0 ? irq_id : -ENXIO;
-	}
 
 	ret = devm_request_irq(dev, irq_id, mtk_btcvsd_snd_irq_handler,
 			       IRQF_TRIGGER_LOW, "BTCVSD_ISR_Handle",
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +1 -3
index 7064a9fd6f74..9af76ae315a5 100644
@@ -1342,10 +1342,8 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	irq_id = platform_get_irq_byname(pdev, "asys");
-	if (irq_id < 0) {
-		dev_err(dev, "unable to get ASYS IRQ\n");
+	if (irq_id < 0)
 		return irq_id;
-	}
 
 	ret = devm_request_irq(dev, irq_id, mt2701_asys_isr,
 			       IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +1 -3
index 0382896c162e..2d45d44ee97b 100644
@@ -1075,10 +1075,8 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
 	afe->dev = &pdev->dev;
 
 	irq_id = platform_get_irq(pdev, 0);
-	if (irq_id <= 0) {
-		dev_err(afe->dev, "np %pOFn no irq\n", afe->dev->of_node);
+	if (irq_id <= 0)
 		return irq_id < 0 ? irq_id : -ENXIO;
-	}
 	ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
 			       0, "Afe_ISR_Handle", (void *)afe);
 	if (ret) {
sound/soc/mxs/mxs-saif.c +2 -6
index 269b6d6df250..ccfec47f63e8 100644
@@ -793,12 +793,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
 		return PTR_ERR(saif->base);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		ret = irq;
-		dev_err(&pdev->dev, "failed to get irq resource: %d\n",
-			ret);
-		return ret;
-	}
+	if (irq < 0)
+		return irq;
 
 	saif->dev = &pdev->dev;
 	ret = devm_request_irq(&pdev->dev, irq, mxs_saif_irq, 0,
sound/soc/qcom/lpass-platform.c +1 -4
index cf7a299f4547..4c745baa39f7 100644
@@ -564,11 +564,8 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
 	int ret;
 
 	drvdata->lpaif_irq = platform_get_irq_byname(pdev, "lpass-irq-lpaif");
-	if (drvdata->lpaif_irq < 0) {
-		dev_err(&pdev->dev, "error getting irq handle: %d\n",
-			drvdata->lpaif_irq);
+	if (drvdata->lpaif_irq < 0)
 		return -ENODEV;
-	}
 
 	/* ensure audio hardware is disabled */
 	ret = regmap_write(drvdata->lpaif_map,
sound/soc/sof/intel/bdw.c +1 -4
index 70d524ef9bc0..4bb9636da990 100644
@@ -613,11 +613,8 @@ static int bdw_probe(struct snd_sof_dev *sdev)
 
 	/* register our IRQ */
 	sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
-	if (sdev->ipc_irq < 0) {
-		dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
-			desc->irqindex_host_ipc);
+	if (sdev->ipc_irq < 0)
 		return sdev->ipc_irq;
-	}
 
 	dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
 	ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
sound/soc/sof/intel/byt.c +1 -4
index 107d711efc3f..000d576f6a8d 100644
@@ -728,11 +728,8 @@ static int byt_acpi_probe(struct snd_sof_dev *sdev)
 irq:
 	/* register our IRQ */
 	sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
-	if (sdev->ipc_irq < 0) {
-		dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
-			desc->irqindex_host_ipc);
+	if (sdev->ipc_irq < 0)
 		return sdev->ipc_irq;
-	}
 
 	dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
 	ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
sound/soc/sprd/sprd-mcdt.c +1 -3
index 7448015a4935..f439e5503a3c 100644
@@ -959,10 +959,8 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, mcdt);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Failed to get MCDT interrupt\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, sprd_mcdt_irq_handler,
 			       0, "sprd-mcdt", mcdt);
sound/soc/sti/sti_uniperif.c +1 -3
index 645bcbe91601..ee4a0151e63e 100644
@@ -426,10 +426,8 @@ static int sti_uniperiph_cpu_dai_of(struct device_node *node,
 				     UNIPERIF_FIFO_DATA_OFFSET(uni);
 
 	uni->irq = platform_get_irq(priv->pdev, 0);
-	if (uni->irq < 0) {
-		dev_err(dev, "Failed to get IRQ resource\n");
+	if (uni->irq < 0)
 		return -ENXIO;
-	}
 
 	uni->type = dev_data->type;
 
sound/soc/stm/stm32_i2s.c +1 -4
index ba6452dab69b..3e7226a53e53 100644
@@ -855,11 +855,8 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
 
 	/* Get irqs */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		if (irq != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, IRQF_ONESHOT,
 			       dev_name(&pdev->dev), i2s);
sound/soc/stm/stm32_sai.c +1 -3
index 63f68e663676..1c4cc1ca1eaa 100644
@@ -195,10 +195,8 @@ static int stm32_sai_probe(struct platform_device *pdev)
 
 	/* init irqs */
 	sai->irq = platform_get_irq(pdev, 0);
-	if (sai->irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (sai->irq < 0)
 		return sai->irq;
-	}
 
 	/* reset */
 	rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
sound/soc/stm/stm32_spdifrx.c +1 -3
index ee71b898897b..cd4b235fce57 100644
@@ -909,10 +909,8 @@ static int stm32_spdifrx_parse_of(struct platform_device *pdev,
 	}
 
 	spdifrx->irq = platform_get_irq(pdev, 0);
-	if (spdifrx->irq < 0) {
-		dev_err(&pdev->dev, "No irq for node %s\n", pdev->name);
+	if (spdifrx->irq < 0)
 		return spdifrx->irq;
-	}
 
 	return 0;
 }
sound/soc/sunxi/sun4i-i2s.c +1 -3
index 9b2232908b65..d97d694c48df 100644
@@ -1087,10 +1087,8 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
 		return PTR_ERR(regs);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Can't retrieve our interrupt\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	i2s->variant = of_device_get_match_data(&pdev->dev);
 	if (!i2s->variant) {
sound/soc/uniphier/aio-dma.c +1 -3
index fa001d3c1a88..2261655be10d 100644
@@ -291,10 +291,8 @@ int uniphier_aiodma_soc_register_platform(struct platform_device *pdev)
 		return PTR_ERR(chip->regmap);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Could not get irq.\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, aiodma_irq,
 			       IRQF_SHARED, dev_name(dev), pdev);
sound/soc/xilinx/xlnx_formatter_pcm.c +0 -2
index dc8721f4f56b..48970efe7838 100644
@@ -613,7 +613,6 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
 		aud_drv_data->mm2s_irq = platform_get_irq_byname(pdev,
 								 "irq_mm2s");
 		if (aud_drv_data->mm2s_irq < 0) {
-			dev_err(dev, "xlnx audio mm2s irq resource failed\n");
 			ret = aud_drv_data->mm2s_irq;
 			goto clk_err;
 		}
@@ -640,7 +639,6 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
 		aud_drv_data->s2mm_irq = platform_get_irq_byname(pdev,
 								 "irq_s2mm");
 		if (aud_drv_data->s2mm_irq < 0) {
-			dev_err(dev, "xlnx audio s2mm irq resource failed\n");
 			ret = aud_drv_data->s2mm_irq;
 			goto clk_err;
 		}
sound/soc/xtensa/xtfpga-i2s.c +0 -1
index 9ce2c75186b9..e635bf08d935 100644
@@ -572,7 +572,6 @@ static int xtfpga_i2s_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "No IRQ resource\n");
 		err = irq;
 		goto err;
 	}
Signature · 1 line
Sent by a computer through tubes
maintainer
#112 lore raw

Applied "ASoC: Remove dev_err() usage after platform_get_irq()" to the asoc tree

The patch

ASoC: Remove dev_err() usage after platform_get_irq()

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From cf9441adb1a35506d7606866c382b9d8614169b5 Mon Sep 17 00:00:00 2001

From: Stephen Boyd <[email protected]>
Date: Tue, 30 Jul 2019 11:15:49 -0700
Subject: [PATCH] ASoC: 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).

---
 sound/soc/atmel/atmel-classd.c             |  7 ++-----
 sound/soc/atmel/atmel-pdmic.c              |  7 ++-----
 sound/soc/bcm/cygnus-ssp.c                 |  7 ++-----
 sound/soc/codecs/msm8916-wcd-analog.c      | 12 +++---------
 sound/soc/codecs/twl6040.c                 |  4 +---
 sound/soc/fsl/fsl_asrc.c                   |  4 +---
 sound/soc/fsl/fsl_esai.c                   |  4 +---
 sound/soc/fsl/fsl_sai.c                    |  4 +---
 sound/soc/fsl/fsl_spdif.c                  |  4 +---
 sound/soc/fsl/fsl_ssi.c                    |  4 +---
 sound/soc/fsl/imx-ssi.c                    |  4 +---
 sound/soc/kirkwood/kirkwood-i2s.c          |  4 +---
 sound/soc/mediatek/common/mtk-btcvsd.c     |  4 +---
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c |  4 +---
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c |  4 +---
 sound/soc/mxs/mxs-saif.c                   |  8 ++------
 sound/soc/qcom/lpass-platform.c            |  5 +----
 sound/soc/sof/intel/bdw.c                  |  5 +----
 sound/soc/sof/intel/byt.c                  |  5 +----
 sound/soc/sprd/sprd-mcdt.c                 |  4 +---
 sound/soc/sti/sti_uniperif.c               |  4 +---
 sound/soc/stm/stm32_i2s.c                  |  5 +----
 sound/soc/stm/stm32_sai.c                  |  4 +---
 sound/soc/stm/stm32_spdifrx.c              |  4 +---
 sound/soc/sunxi/sun4i-i2s.c                |  4 +---
 sound/soc/uniphier/aio-dma.c               |  4 +---
 sound/soc/xilinx/xlnx_formatter_pcm.c      |  2 --
 sound/soc/xtensa/xtfpga-i2s.c              |  1 -
 28 files changed, 32 insertions(+), 100 deletions(-)
sound/soc/atmel/atmel-classd.c +2 -5
index 0f2c574f27f1..e98601eccfa3 100644
@@ -571,11 +571,8 @@ static int atmel_classd_probe(struct platform_device *pdev)
 	dd->pdata = pdata;
 
 	dd->irq = platform_get_irq(pdev, 0);
-	if (dd->irq < 0) {
-		ret = dd->irq;
-		dev_err(dev, "failed to could not get irq: %d\n", ret);
-		return ret;
-	}
+	if (dd->irq < 0)
+		return dd->irq;
 
 	dd->pclk = devm_clk_get(dev, "pclk");
 	if (IS_ERR(dd->pclk)) {
sound/soc/atmel/atmel-pdmic.c +2 -5
index e09c28349e0d..04ec6f0af179 100644
@@ -612,11 +612,8 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
 	dd->dev = dev;
 
 	dd->irq = platform_get_irq(pdev, 0);
-	if (dd->irq < 0) {
-		ret = dd->irq;
-		dev_err(dev, "failed to get irq: %d\n", ret);
-		return ret;
-	}
+	if (dd->irq < 0)
+		return dd->irq;
 
 	dd->pclk = devm_clk_get(dev, "pclk");
 	if (IS_ERR(dd->pclk)) {
sound/soc/bcm/cygnus-ssp.c +2 -5
index b7c358b48d8d..2f9357d7da96 100644
@@ -1342,11 +1342,8 @@ static int cygnus_ssp_probe(struct platform_device *pdev)
 	}
 
 	cygaud->irq_num = platform_get_irq(pdev, 0);
-	if (cygaud->irq_num <= 0) {
-		dev_err(dev, "platform_get_irq failed\n");
-		err = cygaud->irq_num;
-		return err;
-	}
+	if (cygaud->irq_num <= 0)
+		return cygaud->irq_num;
 
 	err = audio_clk_init(pdev, cygaud);
 	if (err) {
sound/soc/codecs/msm8916-wcd-analog.c +3 -9
index 368b6c09474b..667e9f73aba3 100644
@@ -1185,10 +1185,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq_byname(pdev, "mbhc_switch_int");
-	if (irq < 0) {
-		dev_err(dev, "failed to get mbhc switch irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, irq, NULL,
 			       pm8916_mbhc_switch_irq_handler,
@@ -1200,10 +1198,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
 
 	if (priv->mbhc_btn_enabled) {
 		irq = platform_get_irq_byname(pdev, "mbhc_but_press_det");
-		if (irq < 0) {
-			dev_err(dev, "failed to get button press irq\n");
+		if (irq < 0)
 			return irq;
-		}
 
 		ret = devm_request_threaded_irq(dev, irq, NULL,
 				       mbhc_btn_press_irq_handler,
@@ -1214,10 +1210,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
 			dev_err(dev, "cannot request mbhc button press irq\n");
 
 		irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det");
-		if (irq < 0) {
-			dev_err(dev, "failed to get button release irq\n");
+		if (irq < 0)
 			return irq;
-		}
 
 		ret = devm_request_threaded_irq(dev, irq, NULL,
 				       mbhc_btn_release_irq_handler,
sound/soc/codecs/twl6040.c +1 -3
index 472c2fff34a8..f34637afee51 100644
@@ -1108,10 +1108,8 @@ static int twl6040_probe(struct snd_soc_component *component)
 	priv->component = component;
 
 	priv->plug_irq = platform_get_irq(pdev, 0);
-	if (priv->plug_irq < 0) {
-		dev_err(component->dev, "invalid irq: %d\n", priv->plug_irq);
+	if (priv->plug_irq < 0)
 		return priv->plug_irq;
-	}
 
 	INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work);
 
sound/soc/fsl/fsl_asrc.c +1 -3
index cbbf6257f08a..cfa40ef6b1ca 100644
@@ -885,10 +885,8 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
 			       dev_name(&pdev->dev), asrc_priv);
sound/soc/fsl/fsl_esai.c +1 -3
index 4ce8ac769244..5832144beb9f 100644
@@ -962,10 +962,8 @@ static int fsl_esai_probe(struct platform_device *pdev)
 				PTR_ERR(esai_priv->spbaclk));
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
 			       esai_priv->name, esai_priv);
sound/soc/fsl/fsl_sai.c +1 -3
index 6d3c6c8d50ce..8f4d9fa95599 100644
@@ -831,10 +831,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
 	if (ret) {
sound/soc/fsl/fsl_spdif.c +1 -3
index 4842e6df9a2d..7858a5499ac5 100644
@@ -1248,10 +1248,8 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
 			       dev_name(&pdev->dev), spdif_priv);
sound/soc/fsl/fsl_ssi.c +1 -3
index fa862af25c1a..b0a6fead1a6a 100644
@@ -1510,10 +1510,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 	}
 
 	ssi->irq = platform_get_irq(pdev, 0);
-	if (ssi->irq < 0) {
-		dev_err(dev, "no irq for node %s\n", pdev->name);
+	if (ssi->irq < 0)
 		return ssi->irq;
-	}
 
 	/* Set software limitations for synchronous mode except AC97 */
 	if (ssi->synchronous && !fsl_ssi_is_ac97(ssi)) {
sound/soc/fsl/imx-ssi.c +1 -3
index 9038b61317be..42031ba7da31 100644
@@ -520,10 +520,8 @@ static int imx_ssi_probe(struct platform_device *pdev)
 	}
 
 	ssi->irq = platform_get_irq(pdev, 0);
-	if (ssi->irq < 0) {
-		dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq);
+	if (ssi->irq < 0)
 		return ssi->irq;
-	}
 
 	ssi->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(ssi->clk)) {
sound/soc/kirkwood/kirkwood-i2s.c +1 -3
index 5076ec4cc7a6..61226fefe1c4 100644
@@ -537,10 +537,8 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->io);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (priv->irq < 0) {
-		dev_err(&pdev->dev, "platform_get_irq failed: %d\n", priv->irq);
+	if (priv->irq < 0)
 		return priv->irq;
-	}
 
 	if (np) {
 		priv->burst = 128;		/* might be 32 or 128 */
sound/soc/mediatek/common/mtk-btcvsd.c +1 -3
index c7a81c4be068..d00608c73c6e 100644
@@ -1335,10 +1335,8 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 
 	/* irq */
 	irq_id = platform_get_irq(pdev, 0);
-	if (irq_id <= 0) {
-		dev_err(dev, "%pOFn no irq found\n", dev->of_node);
+	if (irq_id <= 0)
 		return irq_id < 0 ? irq_id : -ENXIO;
-	}
 
 	ret = devm_request_irq(dev, irq_id, mtk_btcvsd_snd_irq_handler,
 			       IRQF_TRIGGER_LOW, "BTCVSD_ISR_Handle",
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +1 -3
index 7064a9fd6f74..9af76ae315a5 100644
@@ -1342,10 +1342,8 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	irq_id = platform_get_irq_byname(pdev, "asys");
-	if (irq_id < 0) {
-		dev_err(dev, "unable to get ASYS IRQ\n");
+	if (irq_id < 0)
 		return irq_id;
-	}
 
 	ret = devm_request_irq(dev, irq_id, mt2701_asys_isr,
 			       IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +1 -3
index 90bd2c92cae7..0ee29255e731 100644
@@ -1074,10 +1074,8 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
 	afe->dev = &pdev->dev;
 
 	irq_id = platform_get_irq(pdev, 0);
-	if (irq_id <= 0) {
-		dev_err(afe->dev, "np %pOFn no irq\n", afe->dev->of_node);
+	if (irq_id <= 0)
 		return irq_id < 0 ? irq_id : -ENXIO;
-	}
 	ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
 			       0, "Afe_ISR_Handle", (void *)afe);
 	if (ret) {
sound/soc/mxs/mxs-saif.c +2 -6
index a2c79426513b..1e38ce858326 100644
@@ -790,12 +790,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
 		return PTR_ERR(saif->base);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		ret = irq;
-		dev_err(&pdev->dev, "failed to get irq resource: %d\n",
-			ret);
-		return ret;
-	}
+	if (irq < 0)
+		return irq;
 
 	saif->dev = &pdev->dev;
 	ret = devm_request_irq(&pdev->dev, irq, mxs_saif_irq, 0,
sound/soc/qcom/lpass-platform.c +1 -4
index cf7a299f4547..4c745baa39f7 100644
@@ -564,11 +564,8 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
 	int ret;
 
 	drvdata->lpaif_irq = platform_get_irq_byname(pdev, "lpass-irq-lpaif");
-	if (drvdata->lpaif_irq < 0) {
-		dev_err(&pdev->dev, "error getting irq handle: %d\n",
-			drvdata->lpaif_irq);
+	if (drvdata->lpaif_irq < 0)
 		return -ENODEV;
-	}
 
 	/* ensure audio hardware is disabled */
 	ret = regmap_write(drvdata->lpaif_map,
sound/soc/sof/intel/bdw.c +1 -4
index 70d524ef9bc0..4bb9636da990 100644
@@ -613,11 +613,8 @@ static int bdw_probe(struct snd_sof_dev *sdev)
 
 	/* register our IRQ */
 	sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
-	if (sdev->ipc_irq < 0) {
-		dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
-			desc->irqindex_host_ipc);
+	if (sdev->ipc_irq < 0)
 		return sdev->ipc_irq;
-	}
 
 	dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
 	ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
sound/soc/sof/intel/byt.c +1 -4
index 107d711efc3f..000d576f6a8d 100644
@@ -728,11 +728,8 @@ static int byt_acpi_probe(struct snd_sof_dev *sdev)
 irq:
 	/* register our IRQ */
 	sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
-	if (sdev->ipc_irq < 0) {
-		dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
-			desc->irqindex_host_ipc);
+	if (sdev->ipc_irq < 0)
 		return sdev->ipc_irq;
-	}
 
 	dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
 	ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
sound/soc/sprd/sprd-mcdt.c +1 -3
index 7448015a4935..f439e5503a3c 100644
@@ -959,10 +959,8 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, mcdt);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Failed to get MCDT interrupt\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, sprd_mcdt_irq_handler,
 			       0, "sprd-mcdt", mcdt);
sound/soc/sti/sti_uniperif.c +1 -3
index 645bcbe91601..ee4a0151e63e 100644
@@ -426,10 +426,8 @@ static int sti_uniperiph_cpu_dai_of(struct device_node *node,
 				     UNIPERIF_FIFO_DATA_OFFSET(uni);
 
 	uni->irq = platform_get_irq(priv->pdev, 0);
-	if (uni->irq < 0) {
-		dev_err(dev, "Failed to get IRQ resource\n");
+	if (uni->irq < 0)
 		return -ENXIO;
-	}
 
 	uni->type = dev_data->type;
 
sound/soc/stm/stm32_i2s.c +1 -4
index ba6452dab69b..3e7226a53e53 100644
@@ -855,11 +855,8 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
 
 	/* Get irqs */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		if (irq != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, IRQF_ONESHOT,
 			       dev_name(&pdev->dev), i2s);
sound/soc/stm/stm32_sai.c +1 -3
index 1ac5103cea78..ef4273361d0d 100644
@@ -193,10 +193,8 @@ static int stm32_sai_probe(struct platform_device *pdev)
 
 	/* init irqs */
 	sai->irq = platform_get_irq(pdev, 0);
-	if (sai->irq < 0) {
-		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+	if (sai->irq < 0)
 		return sai->irq;
-	}
 
 	/* reset */
 	rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
sound/soc/stm/stm32_spdifrx.c +1 -3
index ee71b898897b..cd4b235fce57 100644
@@ -909,10 +909,8 @@ static int stm32_spdifrx_parse_of(struct platform_device *pdev,
 	}
 
 	spdifrx->irq = platform_get_irq(pdev, 0);
-	if (spdifrx->irq < 0) {
-		dev_err(&pdev->dev, "No irq for node %s\n", pdev->name);
+	if (spdifrx->irq < 0)
 		return spdifrx->irq;
-	}
 
 	return 0;
 }
sound/soc/sunxi/sun4i-i2s.c +1 -3
index 9b2232908b65..d97d694c48df 100644
@@ -1087,10 +1087,8 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
 		return PTR_ERR(regs);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Can't retrieve our interrupt\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	i2s->variant = of_device_get_match_data(&pdev->dev);
 	if (!i2s->variant) {
sound/soc/uniphier/aio-dma.c +1 -3
index 862346d66774..e8446cc4e8f8 100644
@@ -289,10 +289,8 @@ int uniphier_aiodma_soc_register_platform(struct platform_device *pdev)
 		return PTR_ERR(chip->regmap);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Could not get irq.\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, aiodma_irq,
 			       IRQF_SHARED, dev_name(dev), pdev);
sound/soc/xilinx/xlnx_formatter_pcm.c +0 -2
index dc8721f4f56b..48970efe7838 100644
@@ -613,7 +613,6 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
 		aud_drv_data->mm2s_irq = platform_get_irq_byname(pdev,
 								 "irq_mm2s");
 		if (aud_drv_data->mm2s_irq < 0) {
-			dev_err(dev, "xlnx audio mm2s irq resource failed\n");
 			ret = aud_drv_data->mm2s_irq;
 			goto clk_err;
 		}
@@ -640,7 +639,6 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
 		aud_drv_data->s2mm_irq = platform_get_irq_byname(pdev,
 								 "irq_s2mm");
 		if (aud_drv_data->s2mm_irq < 0) {
-			dev_err(dev, "xlnx audio s2mm irq resource failed\n");
 			ret = aud_drv_data->s2mm_irq;
 			goto clk_err;
 		}
sound/soc/xtensa/xtfpga-i2s.c +0 -1
index 9da395d14a8d..efd374f114a0 100644
@@ -570,7 +570,6 @@ static int xtfpga_i2s_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "No IRQ resource\n");
 		err = irq;
 		goto err;
 	}
Signature · 1 line
2.20.1
#113 lore raw

PATCH v6 50/57 gpu: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Alex Deucher <[email protected]>
Cc Chris Wilson <[email protected]>
Cc "Ville Syrjälä" <[email protected]>
Cc "Christian König" <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/gpu/drm/etnaviv/etnaviv_gpu.c       | 4 +---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c     | 4 +---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c     | 1 -
 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 4 +---
 drivers/gpu/drm/exynos/exynos_drm_scaler.c  | 4 +---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c   | 4 +---
 drivers/gpu/drm/imx/imx-tve.c               | 4 +---
 drivers/gpu/drm/ingenic/ingenic-drm.c       | 4 +---
 drivers/gpu/drm/mediatek/mtk_cec.c          | 4 +---
 drivers/gpu/drm/mediatek/mtk_dpi.c          | 4 +---
 drivers/gpu/drm/mediatek/mtk_dsi.c          | 4 +---
 drivers/gpu/drm/meson/meson_dw_hdmi.c       | 4 +---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c    | 4 +---
 drivers/gpu/drm/sun4i/sun4i_tcon.c          | 4 +---
 drivers/gpu/drm/tegra/dc.c                  | 4 +---
 drivers/gpu/drm/tegra/dpaux.c               | 4 +---
 drivers/gpu/drm/tegra/sor.c                 | 4 +---
 drivers/gpu/host1x/dev.c                    | 4 +---
 18 files changed, 17 insertions(+), 52 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_gpu.c +1 -3
index 5418a1a87b2c..373077549aa4 100644
@@ -1733,10 +1733,8 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
 
 	/* Get Interrupt: */
 	gpu->irq = platform_get_irq(pdev, 0);
-	if (gpu->irq < 0) {
-		dev_err(dev, "failed to get irq: %d\n", gpu->irq);
+	if (gpu->irq < 0)
 		return gpu->irq;
-	}
 
 	err = devm_request_irq(&pdev->dev, gpu->irq, irq_handler, 0,
 			       dev_name(gpu->dev), gpu);
drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -3
index 6926cee91b36..6b679c59c84d 100644
@@ -1789,10 +1789,8 @@ static int exynos_dsi_probe(struct platform_device *pdev)
 	}
 
 	dsi->irq = platform_get_irq(pdev, 0);
-	if (dsi->irq < 0) {
-		dev_err(dev, "failed to request dsi irq resource\n");
+	if (dsi->irq < 0)
 		return dsi->irq;
-	}
 
 	irq_set_status_flags(dsi->irq, IRQ_NOAUTOEN);
 	ret = devm_request_threaded_irq(dev, dsi->irq, NULL,
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0 -1
index 50904eee96f7..371419d3e8a6 100644
@@ -1497,7 +1497,6 @@ static int g2d_probe(struct platform_device *pdev)
 
 	g2d->irq = platform_get_irq(pdev, 0);
 	if (g2d->irq < 0) {
-		dev_err(dev, "failed to get irq\n");
 		ret = g2d->irq;
 		goto err_put_clk;
 	}
drivers/gpu/drm/exynos/exynos_drm_rotator.c +1 -3
index 8ebad2740ad5..a355f444210a 100644
@@ -290,10 +290,8 @@ static int rotator_probe(struct platform_device *pdev)
 		return PTR_ERR(rot->regs);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "failed to get irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, rotator_irq_handler, 0, dev_name(dev),
 			       rot);
drivers/gpu/drm/exynos/exynos_drm_scaler.c +1 -3
index 9af096479e1c..cef771d5956c 100644
@@ -499,10 +499,8 @@ static int scaler_probe(struct platform_device *pdev)
 		return PTR_ERR(scaler->regs);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "failed to get irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, irq, NULL,	scaler_irq_handler,
 					IRQF_ONESHOT, "drm_scaler", scaler);
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -3
index e81daaaa5965..f56e9c44e8c9 100644
@@ -269,10 +269,8 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
 	}
 
 	fsl_dev->irq = platform_get_irq(pdev, 0);
-	if (fsl_dev->irq < 0) {
-		dev_err(dev, "failed to get irq\n");
+	if (fsl_dev->irq < 0)
 		return fsl_dev->irq;
-	}
 
 	fsl_dev->regmap = devm_regmap_init_mmio(dev, base,
 			&fsl_dcu_regmap_config);
drivers/gpu/drm/imx/imx-tve.c +1 -3
index e725af8a0025..8b768e0cf167 100644
@@ -594,10 +594,8 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "failed to get irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, irq, NULL,
 					imx_tve_irq_handler, IRQF_ONESHOT,
drivers/gpu/drm/ingenic/ingenic-drm.c +1 -3
index e9f9e9fb9b17..faf8ac8ca1ef 100644
@@ -630,10 +630,8 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Failed to get platform irq");
+	if (irq < 0)
 		return irq;
-	}
 
 	if (soc_info->needs_dev_clk) {
 		priv->lcd_clk = devm_clk_get(dev, "lcd");
drivers/gpu/drm/mediatek/mtk_cec.c +1 -3
index cb29b649fcdb..332a4dfbdde7 100644
@@ -208,10 +208,8 @@ static int mtk_cec_probe(struct platform_device *pdev)
 	}
 
 	cec->irq = platform_get_irq(pdev, 0);
-	if (cec->irq < 0) {
-		dev_err(dev, "Failed to get cec irq: %d\n", cec->irq);
+	if (cec->irq < 0)
 		return cec->irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, cec->irq, NULL,
 					mtk_cec_htplg_isr_thread,
drivers/gpu/drm/mediatek/mtk_dpi.c +1 -3
index bacd989cc9aa..87b848ca5f6c 100644
@@ -717,10 +717,8 @@ static int mtk_dpi_probe(struct platform_device *pdev)
 	}
 
 	dpi->irq = platform_get_irq(pdev, 0);
-	if (dpi->irq <= 0) {
-		dev_err(dev, "Failed to get irq: %d\n", dpi->irq);
+	if (dpi->irq <= 0)
 		return -EINVAL;
-	}
 
 	ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
 					  NULL, &dpi->bridge);
drivers/gpu/drm/mediatek/mtk_dsi.c +1 -3
index b91c4616644a..7a3aad0dc8a3 100644
@@ -1155,10 +1155,8 @@ static int mtk_dsi_probe(struct platform_device *pdev)
 	}
 
 	irq_num = platform_get_irq(pdev, 0);
-	if (irq_num < 0) {
-		dev_err(&pdev->dev, "failed to request dsi irq resource\n");
+	if (irq_num < 0)
 		return -EPROBE_DEFER;
-	}
 
 	irq_set_status_flags(irq_num, IRQ_TYPE_LEVEL_LOW);
 	ret = devm_request_irq(&pdev->dev, irq_num, mtk_dsi_irq,
drivers/gpu/drm/meson/meson_dw_hdmi.c +1 -3
index df3f9ddd2234..e1099dab45b4 100644
@@ -894,10 +894,8 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 		return PTR_ERR(dw_plat_data->regm);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Failed to get hdmi top irq\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_threaded_irq(dev, irq, dw_hdmi_top_irq,
 					dw_hdmi_top_thread_irq, IRQF_SHARED,
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -3
index 252f5ebb1acc..9feabccd34d6 100644
@@ -822,10 +822,8 @@ static int omap_dmm_probe(struct platform_device *dev)
 	}
 
 	omap_dmm->irq = platform_get_irq(dev, 0);
-	if (omap_dmm->irq < 0) {
-		dev_err(&dev->dev, "failed to get IRQ resource\n");
+	if (omap_dmm->irq < 0)
 		goto fail;
-	}
 
 	omap_dmm->dev = &dev->dev;
 
drivers/gpu/drm/sun4i/sun4i_tcon.c +1 -3
index 64c43ee6bd92..7c4cb3f5d444 100644
@@ -783,10 +783,8 @@ static int sun4i_tcon_init_irq(struct device *dev,
 	int irq, ret;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Couldn't retrieve the TCON interrupt\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	ret = devm_request_irq(dev, irq, sun4i_tcon_handler, 0,
 			       dev_name(dev), tcon);
drivers/gpu/drm/tegra/dc.c +1 -3
index 4a75d149e368..e00bee26d29b 100644
@@ -2469,10 +2469,8 @@ static int tegra_dc_probe(struct platform_device *pdev)
 		return PTR_ERR(dc->regs);
 
 	dc->irq = platform_get_irq(pdev, 0);
-	if (dc->irq < 0) {
-		dev_err(&pdev->dev, "failed to get IRQ\n");
+	if (dc->irq < 0)
 		return -ENXIO;
-	}
 
 	err = tegra_dc_rgb_probe(dc);
 	if (err < 0 && err != -ENODEV) {
drivers/gpu/drm/tegra/dpaux.c +1 -3
index 2d94da225e51..edf5cfa9fb74 100644
@@ -446,10 +446,8 @@ static int tegra_dpaux_probe(struct platform_device *pdev)
 		return PTR_ERR(dpaux->regs);
 
 	dpaux->irq = platform_get_irq(pdev, 0);
-	if (dpaux->irq < 0) {
-		dev_err(&pdev->dev, "failed to get IRQ\n");
+	if (dpaux->irq < 0)
 		return -ENXIO;
-	}
 
 	if (!pdev->dev.pm_domain) {
 		dpaux->rst = devm_reset_control_get(&pdev->dev, "dpaux");
drivers/gpu/drm/tegra/sor.c +1 -3
index 4ffe3794e6d3..651400485384 100644
@@ -3323,10 +3323,8 @@ static int tegra_sor_probe(struct platform_device *pdev)
 	}
 
 	err = platform_get_irq(pdev, 0);
-	if (err < 0) {
-		dev_err(&pdev->dev, "failed to get IRQ: %d\n", err);
+	if (err < 0)
 		goto remove;
-	}
 
 	sor->irq = err;
 
drivers/gpu/host1x/dev.c +1 -3
index 5a3f797240d4..1fa55dc1a109 100644
@@ -214,10 +214,8 @@ static int host1x_probe(struct platform_device *pdev)
 	}
 
 	syncpt_irq = platform_get_irq(pdev, 0);
-	if (syncpt_irq < 0) {
-		dev_err(&pdev->dev, "failed to get IRQ: %d\n", syncpt_irq);
+	if (syncpt_irq < 0)
 		return syncpt_irq;
-	}
 
 	mutex_init(&host->devices_lock);
 	INIT_LIST_HEAD(&host->devices);
Signature · 1 line
Sent by a computer through tubes
#114 lore raw

PATCH v6 51/57 net: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 "David S. Miller" <[email protected]>
Cc Kalle Valo <[email protected]>
Cc Saeed Mahameed <[email protected]>
Cc Jeff Kirsher <[email protected]>
Cc Felix Fietkau <[email protected]>
Cc Lorenzo Bianconi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/net/can/janz-ican3.c                       |  1 -
 drivers/net/can/rcar/rcar_can.c                    |  1 -
 drivers/net/can/rcar/rcar_canfd.c                  |  2 --
 drivers/net/can/sun4i_can.c                        |  1 -
 drivers/net/ethernet/amd/au1000_eth.c              |  1 -
 drivers/net/ethernet/amd/xgbe/xgbe-platform.c      | 14 +++-----------
 drivers/net/ethernet/apm/xgene-v2/main.c           |  4 +---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c   |  4 +---
 drivers/net/ethernet/aurora/nb8800.c               |  4 +---
 drivers/net/ethernet/broadcom/bgmac-platform.c     |  4 +---
 drivers/net/ethernet/cortina/gemini.c              |  4 +---
 drivers/net/ethernet/davicom/dm9000.c              |  2 --
 drivers/net/ethernet/hisilicon/hisi_femac.c        |  1 -
 drivers/net/ethernet/lantiq_xrx200.c               | 10 ++--------
 drivers/net/ethernet/nuvoton/w90p910_ether.c       |  2 --
 drivers/net/ethernet/qualcomm/emac/emac.c          |  5 +----
 drivers/net/ethernet/socionext/sni_ave.c           |  4 +---
 .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c    |  7 +------
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |  7 +------
 drivers/net/wireless/mediatek/mt76/mt7603/soc.c    |  4 +---
 20 files changed, 15 insertions(+), 67 deletions(-)
drivers/net/can/janz-ican3.c +0 -1
index 19d4f52a8f90..a761092e6ac9 100644
@@ -1936,7 +1936,6 @@ static int ican3_probe(struct platform_device *pdev)
 	/* find our IRQ number */
 	mod->irq = platform_get_irq(pdev, 0);
 	if (mod->irq < 0) {
-		dev_err(dev, "IRQ line not found\n");
 		ret = -ENODEV;
 		goto out_free_ndev;
 	}
drivers/net/can/rcar/rcar_can.c +0 -1
index 13e66297b65f..cf218949a8fb 100644
@@ -759,7 +759,6 @@ static int rcar_can_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "No IRQ resource\n");
 		err = irq;
 		goto fail;
 	}
drivers/net/can/rcar/rcar_canfd.c +0 -2
index 05410008aa6b..51eecc7cdcdd 100644
@@ -1651,14 +1651,12 @@ static int rcar_canfd_probe(struct platform_device *pdev)
 
 	ch_irq = platform_get_irq(pdev, 0);
 	if (ch_irq < 0) {
-		dev_err(&pdev->dev, "no Channel IRQ resource\n");
 		err = ch_irq;
 		goto fail_dev;
 	}
 
 	g_irq = platform_get_irq(pdev, 1);
 	if (g_irq < 0) {
-		dev_err(&pdev->dev, "no Global IRQ resource\n");
 		err = g_irq;
 		goto fail_dev;
 	}
drivers/net/can/sun4i_can.c +0 -1
index 093fc9a529f0..f4cd88196404 100644
@@ -787,7 +787,6 @@ static int sun4ican_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "could not get a valid irq\n");
 		err = -ENODEV;
 		goto exit;
 	}
drivers/net/ethernet/amd/au1000_eth.c +0 -1
index 650d1bae5f56..1793950f0582 100644
@@ -1100,7 +1100,6 @@ static int au1000_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to retrieve IRQ\n");
 		err = -ENODEV;
 		goto out;
 	}
drivers/net/ethernet/amd/xgbe/xgbe-platform.c +3 -11
index d0f3dfb88202..dce9e59e8881 100644
@@ -467,10 +467,8 @@ static int xgbe_platform_probe(struct platform_device *pdev)
 
 	/* Get the device interrupt */
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(dev, "platform_get_irq 0 failed\n");
+	if (ret < 0)
 		goto err_io;
-	}
 	pdata->dev_irq = ret;
 
 	/* Get the per channel DMA interrupts */
@@ -479,12 +477,8 @@ static int xgbe_platform_probe(struct platform_device *pdev)
 
 		for (i = 0; (i < max) && (dma_irqnum < dma_irqend); i++) {
 			ret = platform_get_irq(pdata->platdev, dma_irqnum++);
-			if (ret < 0) {
-				netdev_err(pdata->netdev,
-					   "platform_get_irq %u failed\n",
-					   dma_irqnum - 1);
+			if (ret < 0)
 				goto err_io;
-			}
 
 			pdata->channel_irq[i] = ret;
 		}
@@ -496,10 +490,8 @@ static int xgbe_platform_probe(struct platform_device *pdev)
 
 	/* Get the auto-negotiation interrupt */
 	ret = platform_get_irq(phy_pdev, phy_irqnum++);
-	if (ret < 0) {
-		dev_err(dev, "platform_get_irq phy 0 failed\n");
+	if (ret < 0)
 		goto err_io;
-	}
 	pdata->an_irq = ret;
 
 	/* Configure the netdev resource */
drivers/net/ethernet/apm/xgene-v2/main.c +1 -3
index 79048cc46703..02b4f3af02b5 100644
@@ -54,10 +54,8 @@ static int xge_get_resources(struct xge_pdata *pdata)
 	}
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(dev, "Unable to get irq\n");
+	if (ret < 0)
 		return ret;
-	}
 	pdata->resources.irq = ret;
 
 	return 0;
drivers/net/ethernet/apm/xgene/xgene_enet_main.c +1 -3
index 10b1c053e70a..a63baca97f53 100644
@@ -1636,9 +1636,7 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata)
 				pdata->cq_cnt = max_irqs / 2;
 				break;
 			}
-			dev_err(dev, "Unable to get ENET IRQ\n");
-			ret = ret ? : -ENXIO;
-			return ret;
+			return ret ? : -ENXIO;
 		}
 		pdata->irqs[i] = ret;
 	}
drivers/net/ethernet/aurora/nb8800.c +1 -3
index 3b3370a94a9c..37752d9514e7 100644
@@ -1351,10 +1351,8 @@ static int nb8800_probe(struct platform_device *pdev)
 		ops = match->data;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		dev_err(&pdev->dev, "No IRQ\n");
+	if (irq <= 0)
 		return -EINVAL;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(&pdev->dev, res);
drivers/net/ethernet/broadcom/bgmac-platform.c +1 -3
index 6dc0dd91ad11..c46c1b1416f7 100644
@@ -199,10 +199,8 @@ static int bgmac_probe(struct platform_device *pdev)
 		dev_warn(&pdev->dev, "MAC address not present in device tree\n");
 
 	bgmac->irq = platform_get_irq(pdev, 0);
-	if (bgmac->irq < 0) {
-		dev_err(&pdev->dev, "Unable to obtain IRQ\n");
+	if (bgmac->irq < 0)
 		return bgmac->irq;
-	}
 
 	regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "amac_base");
 	if (!regs) {
drivers/net/ethernet/cortina/gemini.c +1 -3
index 9003eb6716cd..5a8d7b44faf9 100644
@@ -2423,10 +2423,8 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
 
 	/* Interrupt */
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		dev_err(dev, "no IRQ\n");
+	if (irq <= 0)
 		return irq ? irq : -ENODEV;
-	}
 	port->irq = irq;
 
 	/* Clock the port */
drivers/net/ethernet/davicom/dm9000.c +0 -2
index 386bdc1378d1..cce90b5925d9 100644
@@ -1500,8 +1500,6 @@ dm9000_probe(struct platform_device *pdev)
 
 	ndev->irq = platform_get_irq(pdev, 0);
 	if (ndev->irq < 0) {
-		dev_err(db->dev, "interrupt resource unavailable: %d\n",
-			ndev->irq);
 		ret = ndev->irq;
 		goto out;
 	}
drivers/net/ethernet/hisilicon/hisi_femac.c +0 -1
index 689f18e3100f..90ab7ade44c4 100644
@@ -877,7 +877,6 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
 
 	ndev->irq = platform_get_irq(pdev, 0);
 	if (ndev->irq <= 0) {
-		dev_err(dev, "No irq resource\n");
 		ret = -ENODEV;
 		goto out_disconnect_phy;
 	}
drivers/net/ethernet/lantiq_xrx200.c +2 -8
index cda641ef89af..900affbdcc0e 100644
@@ -458,17 +458,11 @@ static int xrx200_probe(struct platform_device *pdev)
 	}
 
 	priv->chan_rx.dma.irq = platform_get_irq_byname(pdev, "rx");
-	if (priv->chan_rx.dma.irq < 0) {
-		dev_err(dev, "failed to get RX IRQ, %i\n",
-			priv->chan_rx.dma.irq);
+	if (priv->chan_rx.dma.irq < 0)
 		return -ENOENT;
-	}
 	priv->chan_tx.dma.irq = platform_get_irq_byname(pdev, "tx");
-	if (priv->chan_tx.dma.irq < 0) {
-		dev_err(dev, "failed to get TX IRQ, %i\n",
-			priv->chan_tx.dma.irq);
+	if (priv->chan_tx.dma.irq < 0)
 		return -ENOENT;
-	}
 
 	/* get the clock */
 	priv->clk = devm_clk_get(dev, NULL);
drivers/net/ethernet/nuvoton/w90p910_ether.c +0 -2
index 3d73970b3a2e..219b0b863c89 100644
@@ -993,14 +993,12 @@ static int w90p910_ether_probe(struct platform_device *pdev)
 
 	ether->txirq = platform_get_irq(pdev, 0);
 	if (ether->txirq < 0) {
-		dev_err(&pdev->dev, "failed to get ether tx irq\n");
 		error = -ENXIO;
 		goto failed_free_io;
 	}
 
 	ether->rxirq = platform_get_irq(pdev, 1);
 	if (ether->rxirq < 0) {
-		dev_err(&pdev->dev, "failed to get ether rx irq\n");
 		error = -ENXIO;
 		goto failed_free_io;
 	}
drivers/net/ethernet/qualcomm/emac/emac.c +1 -4
index 59c2349b59df..bfe10464c81f 100644
@@ -556,11 +556,8 @@ static int emac_probe_resources(struct platform_device *pdev,
 
 	/* Core 0 interrupt */
 	ret = platform_get_irq(pdev, 0);
-	if (ret < 0) {
-		dev_err(&pdev->dev,
-			"error: missing core0 irq resource (error=%i)\n", ret);
+	if (ret < 0)
 		return ret;
-	}
 	adpt->irq.irq = ret;
 
 	/* base register address */
drivers/net/ethernet/socionext/sni_ave.c +1 -3
index 51a7b48db4bc..87ab0b5da91e 100644
@@ -1573,10 +1573,8 @@ static int ave_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "IRQ not found\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(dev, res);
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +1 -6
index 3a14cdd01f5f..cac32f7eb6f3 100644
@@ -428,13 +428,8 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
 	 * resource initialization is done in the glue logic.
 	 */
 	stmmac_res.irq = platform_get_irq(pdev, 0);
-	if (stmmac_res.irq < 0) {
-		if (stmmac_res.irq != -EPROBE_DEFER)
-			dev_err(&pdev->dev,
-				"IRQ configuration information not found\n");
-
+	if (stmmac_res.irq < 0)
 		return stmmac_res.irq;
-	}
 	stmmac_res.wol_irq = stmmac_res.irq;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +1 -6
index 73fc2524372e..1ca3d8009b55 100644
@@ -602,13 +602,8 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
 	 * probe if needed before we went too far with resource allocation.
 	 */
 	stmmac_res->irq = platform_get_irq_byname(pdev, "macirq");
-	if (stmmac_res->irq < 0) {
-		if (stmmac_res->irq != -EPROBE_DEFER) {
-			dev_err(&pdev->dev,
-				"MAC IRQ configuration information not found\n");
-		}
+	if (stmmac_res->irq < 0)
 		return stmmac_res->irq;
-	}
 
 	/* On some platforms e.g. SPEAr the wake up irq differs from the mac irq
 	 * The external wake up irq can be passed through the platform code
drivers/net/wireless/mediatek/mt76/mt7603/soc.c +1 -3
index b920be1f5718..c6c1ce69bcbc 100644
@@ -17,10 +17,8 @@ mt76_wmac_probe(struct platform_device *pdev)
 	int ret;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Failed to get device IRQ\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	mem_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(mem_base)) {
Signature · 1 line
Sent by a computer through tubes
maintainer
#115 lore raw

Re: [PATCH v6 51/57] net: Remove dev_err() usage after platform_get_irq()

From: Stephen Boyd <[email protected]>
Date: Tue, 30 Jul 2019 11:15:51 -0700

Quoted 3 lines

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.

...

Quoted 2 lines

While we're here, remove braces on if statements that only have one statement (manually).

...

Quoted 4 lines

---

Please apply directly to subsystem trees

I'll take this into net-next.

#116 lore raw

PATCH v6 52/57 platform/x86: intel_pmc_ipc: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Andy Shevchenko <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>
Cc Hans de Goede <[email protected]>
Cc "Darren Hart (VMware)" <[email protected]>
Cc Roman Kiryanov <[email protected]>
Cc Vadim Pasternak <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/platform/x86/intel_pmc_ipc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/platform/x86/intel_pmc_ipc.c +1 -3
index 55037ff258f8..5c1da2bb1435 100644
@@ -936,10 +936,8 @@ static int ipc_plat_probe(struct platform_device *pdev)
 	spin_lock_init(&ipcdev.gcr_lock);
 
 	ipcdev.irq = platform_get_irq(pdev, 0);
-	if (ipcdev.irq < 0) {
-		dev_err(&pdev->dev, "Failed to get irq\n");
+	if (ipcdev.irq < 0)
 		return -EINVAL;
-	}
 
 	ret = ipc_plat_get_res(pdev);
 	if (ret) {
Signature · 1 line
Sent by a computer through tubes
#117 lore raw

PATCH v6 53/57 platform/mellanox: mlxreg-hotplug: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Andy Shevchenko <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>
Cc Hans de Goede <[email protected]>
Cc "Darren Hart (VMware)" <[email protected]>
Cc Roman Kiryanov <[email protected]>
Cc Vadim Pasternak <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/platform/mellanox/mlxreg-hotplug.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/platform/mellanox/mlxreg-hotplug.c +1 -4
index f85a1b9d129b..706207d192ae 100644
@@ -642,11 +642,8 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
 		priv->irq = pdata->irq;
 	} else {
 		priv->irq = platform_get_irq(pdev, 0);
-		if (priv->irq < 0) {
-			dev_err(&pdev->dev, "Failed to get platform irq: %d\n",
-				priv->irq);
+		if (priv->irq < 0)
 			return priv->irq;
-		}
 	}
 
 	priv->regmap = pdata->regmap;
Signature · 1 line
Sent by a computer through tubes
#118 lore raw

PATCH v6 54/57 platform/x86: intel_bxtwc_tmu: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Andy Shevchenko <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>
Cc Hans de Goede <[email protected]>
Cc "Darren Hart (VMware)" <[email protected]>
Cc Roman Kiryanov <[email protected]>
Cc Vadim Pasternak <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/platform/x86/intel_bxtwc_tmu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/platform/x86/intel_bxtwc_tmu.c +1 -4
index 951c105bafc1..7ccf583649e6 100644
@@ -60,11 +60,8 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev)
 	wctmu->regmap = pmic->regmap;
 
 	irq = platform_get_irq(pdev, 0);
-
-	if (irq < 0) {
-		dev_err(&pdev->dev, "invalid irq %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	regmap_irq_chip = pmic->irq_chip_data_tmu;
 	virq = regmap_irq_get_virq(regmap_irq_chip, irq);
Signature · 1 line
Sent by a computer through tubes
#119 lore raw

PATCH v6 55/57 platform/x86: intel_int0002_vgpio: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Andy Shevchenko <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>
Cc Hans de Goede <[email protected]>
Cc "Darren Hart (VMware)" <[email protected]>
Cc Roman Kiryanov <[email protected]>
Cc Vadim Pasternak <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/platform/x86/intel_int0002_vgpio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/platform/x86/intel_int0002_vgpio.c +1 -3
index d9542c661ddc..4f3f30152a27 100644
@@ -166,10 +166,8 @@ static int int0002_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Error getting IRQ: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
 	if (!chip)
Signature · 1 line
Sent by a computer through tubes
#120 lore raw

Re: [PATCH v6 55/57] platform/x86: intel_int0002_vgpio: Remove dev_err() usage after platform_get_irq()

Quoted 32 lines · Stephen Boyd

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 \) )
{
(

(quoted diff) +0 -4
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }

|
...
-dev_err(...);
)
...
}
// </smpl>

Quoted 2 lines

While we're here, remove braces on if statements that only have one statement (manually).

All 4 pushed to my review and testing queue, thanks!

P.S. Please, consider Cc'ing PDx86 mailing list next time for contribution. Otherwise it misses our patchwork.

Quoted 36 lines
Cc Andy Shevchenko <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>
Cc Hans de Goede <[email protected]>
Cc "Darren Hart (VMware)" <[email protected]>
Cc Roman Kiryanov <[email protected]>
Cc Vadim Pasternak <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/platform/x86/intel_int0002_vgpio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/platform/x86/intel_int0002_vgpio.c +1 -3
index d9542c661ddc..4f3f30152a27 100644
@@ -166,10 +166,8 @@ static int int0002_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Error getting IRQ: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
 	if (!chip)
Signature · 1 line
Sent by a computer through tubes
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#121 lore raw

PATCH v6 56/57 scsi: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 "James E.J. Bottomley" <[email protected]>
Cc "Martin K. Petersen" <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 drivers/scsi/ufs/ufshcd-pltfrm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/ufs/ufshcd-pltfrm.c +0 -1
index d7d521b394c3..f84943553454 100644
@@ -404,7 +404,6 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(dev, "IRQ resource not available\n");
 		err = -ENODEV;
 		goto out;
 	}
Signature · 1 line
Sent by a computer through tubes
#122 lore raw

PATCH v6 57/57 ALSA: x86: Remove dev_err() usage after platform_get_irq()

In reply to Stephen Boyd

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 Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc "Ville Syrjälä" <[email protected]>
Cc Colin Ian King <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Please apply directly to subsystem trees

 sound/x86/intel_hdmi_audio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/x86/intel_hdmi_audio.c +1 -3
index 5fd4e32247a6..cd389d21219a 100644
@@ -1708,10 +1708,8 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
 
 	/* get resources */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "Could not get irq resource: %d\n", irq);
+	if (irq < 0)
 		return irq;
-	}
 
 	res_mmio = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res_mmio) {
Signature · 1 line
Sent by a computer through tubes