Add error message to platform_get_irq*()
Subsystems (220)
Mark Brown
maintainerApplied "spi: Remove dev_err() usage after platform_get_irq()" to the spi tree
In reply to Stephen BoydThe 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
6b8ac10e0dd4b49eda513c1aa5045b3b1660d350Mon 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Re: [PATCH v6 41/57] spi: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydHi Stephen,
Quoted 72 lines · Stephen Boyd
We don't need
dev_err()messages whenplatform_get_irq()fails now thatplatform_get_irq()prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch.// <smpl>
@@
expression ret;
structplatform_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 Mark Brown <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
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 catchdrivers/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
PATCH v6 42/57 staging: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v6 43/57 thermal: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v6 44/57 tty: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v6 45/57 uio: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
PATCH v6 46/57 usb: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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 whenplatform_get_irq()fails now thatplatform_get_irq()prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch.// <smpl>
@@
expression ret;
structplatform_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]>Signed-off-by Stephen Boyd <[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
PATCH v6 47/57 video: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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 whenplatform_get_irq()fails now thatplatform_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;
structplatform_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]>Signed-off-by Stephen Boyd <[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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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; }
PATCH v6 48/57 watchdog: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
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 whenplatform_get_irq()fails now thatplatform_get_irq()prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch.// <smpl>
@@
expression ret;
structplatform_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]>Signed-off-by Stephen Boyd <[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@@ -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
PATCH v6 49/57 ASoC: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Mark Brown
maintainerApplied "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
cf9441adb1a35506d7606866c382b9d8614169b5Mon 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v6 50/57 gpu: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v6 51/57 net: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
David Miller
maintainerRe: [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 whenplatform_get_irq()fails now thatplatform_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
Signed-off-by Stephen Boyd <[email protected]>---
Please apply directly to subsystem trees
I'll take this into net-next.
PATCH v6 52/57 platform/x86: intel_pmc_ipc: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
PATCH v6 53/57 platform/mellanox: mlxreg-hotplug: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
PATCH v6 54/57 platform/x86: intel_bxtwc_tmu: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
PATCH v6 55/57 platform/x86: intel_int0002_vgpio: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
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 whenplatform_get_irq()fails now thatplatform_get_irq()prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch.// <smpl>
@@
expression ret;
structplatform_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]>Signed-off-by Stephen Boyd <[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@@ -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
PATCH v6 56/57 scsi: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
PATCH v6 57/57 ALSA: x86: Remove dev_err() usage after platform_get_irq()
In reply to Stephen BoydWe 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).
---
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
@@ -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
Quoted 5 lines
This is a resend of patch 2/3 from the v5[1] series, but split up to be per-subsystem. Please apply patches directly to subsystem trees if possible.
Would it have been nicer to fix also the commit descriptions before such a resend?
How will the the corresponding software development attention evolve further?
Regards,
Markus