OSDN Git Service

spi: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:41 +0000 (11:15 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 2 Aug 2019 11:15:43 +0000 (12:15 +0100)
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

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

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

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

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

Cc: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-42-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
36 files changed:
drivers/spi/atmel-quadspi.c
drivers/spi/spi-armada-3700.c
drivers/spi/spi-bcm2835.c
drivers/spi/spi-bcm2835aux.c
drivers/spi/spi-bcm63xx-hsspi.c
drivers/spi/spi-bcm63xx.c
drivers/spi/spi-cadence.c
drivers/spi/spi-dw-mmio.c
drivers/spi/spi-efm32.c
drivers/spi/spi-ep93xx.c
drivers/spi/spi-fsl-dspi.c
drivers/spi/spi-fsl-qspi.c
drivers/spi/spi-geni-qcom.c
drivers/spi/spi-lantiq-ssc.c
drivers/spi/spi-mt65xx.c
drivers/spi/spi-npcm-pspi.c
drivers/spi/spi-nuc900.c
drivers/spi/spi-nxp-fspi.c
drivers/spi/spi-pic32-sqi.c
drivers/spi/spi-pic32.c
drivers/spi/spi-qcom-qspi.c
drivers/spi/spi-s3c24xx.c
drivers/spi/spi-sh-msiof.c
drivers/spi/spi-sh.c
drivers/spi/spi-sifive.c
drivers/spi/spi-slave-mt27xx.c
drivers/spi/spi-sprd.c
drivers/spi/spi-stm32-qspi.c
drivers/spi/spi-sun4i.c
drivers/spi/spi-sun6i.c
drivers/spi/spi-synquacer.c
drivers/spi/spi-ti-qspi.c
drivers/spi/spi-uniphier.c
drivers/spi/spi-xlp.c
drivers/spi/spi-zynq-qspi.c
drivers/spi/spi-zynqmp-gqspi.c

index 6a7d7b5..fd8007e 100644 (file)
@@ -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;
        }
index 0328883..119ae87 100644 (file)
@@ -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;
        }
index 6f243a9..c967978 100644 (file)
@@ -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;
        }
index bb57035..b18ce69 100644 (file)
@@ -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;
        }
index 9a06ffd..373cb53 100644 (file)
@@ -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);
index df1c94a..fdd7eaa 100644 (file)
@@ -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)) {
index 7c41e4e..1c35eaa 100644 (file)
@@ -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;
        }
 
index 4fa7e7a..edb3cf6 100644 (file)
@@ -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))
index eb1f214..64d4c44 100644 (file)
@@ -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;
 
index 4034e3e..4e1ccd4 100644 (file)
@@ -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) {
index 53335cc..96eacbe 100644 (file)
@@ -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;
        }
index 41a49b9..443d4c1 100644 (file)
@@ -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);
index 5f0b0d5..242b6c8 100644 (file)
@@ -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);
index 8f01858..9dfe8b0 100644 (file)
@@ -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)
index 45d8a70..1f5f716 100644 (file)
@@ -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;
        }
index 734a2b9..5c56cae 100644 (file)
@@ -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;
        }
index 37e2034..f65a029 100644 (file)
@@ -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;
        }
index 8894f98..501b923 100644 (file)
@@ -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);
index b635526..11b6929 100644 (file)
@@ -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;
        }
index 10cebea..69f517e 100644 (file)
@@ -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");
index e0f0611..a0ad73f 100644 (file)
@@ -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) {
index 48d8dff..aea8fd9 100644 (file)
@@ -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;
        }
index b50bdbc..f73f811 100644 (file)
@@ -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;
        }
index f1ee582..20bdae5 100644 (file)
@@ -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) {
index 93ec2c6..5bf2b57 100644 (file)
@@ -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;
        }
index d107543..61bc43b 100644 (file)
@@ -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;
        }
index 1b7eebb..8c9021b 100644 (file)
@@ -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);
index 655e4af..9ac6f9f 100644 (file)
@@ -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);
index 5194bc0..92e5c66 100644 (file)
@@ -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;
        }
index ee2bdaf..1cf3051 100644 (file)
@@ -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;
        }
index f99abd8..ae17c99 100644 (file)
@@ -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;
        }
index 6ca6007..3cb6537 100644 (file)
@@ -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;
        }
index b32c77d..c1e6f32 100644 (file)
@@ -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;
        }
index 1dc479f..4eb5bc9 100644 (file)
@@ -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) {
index c6bee67..3155e2c 100644 (file)
@@ -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,
index 07a83ca..5e9ea8a 100644 (file)
@@ -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,