OSDN Git Service

dmaengine: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:10 +0000 (11:15 -0700)
committerVinod Koul <vkoul@kernel.org>
Wed, 31 Jul 2019 15:20:53 +0000 (20:50 +0530)
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: Vinod Koul <vkoul@kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: dmaengine@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-11-swboyd@chromium.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
15 files changed:
drivers/dma/dma-jz4780.c
drivers/dma/fsl-edma.c
drivers/dma/fsl-qdma.c
drivers/dma/mediatek/mtk-uart-apdma.c
drivers/dma/qcom/hidma_mgmt.c
drivers/dma/s3c24xx-dma.c
drivers/dma/sh/rcar-dmac.c
drivers/dma/sh/usb-dmac.c
drivers/dma/st_fdma.c
drivers/dma/stm32-dma.c
drivers/dma/stm32-mdma.c
drivers/dma/sun4i-dma.c
drivers/dma/sun6i-dma.c
drivers/dma/uniphier-mdmac.c
drivers/dma/xgene-dma.c

index 9a985a9..cafb1cc 100644 (file)
@@ -886,10 +886,8 @@ static int jz4780_dma_probe(struct platform_device *pdev)
        }
 
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               dev_err(dev, "failed to get IRQ: %d\n", ret);
+       if (ret < 0)
                return ret;
-       }
 
        jzdma->irq = ret;
 
index fcbad6a..71650fa 100644 (file)
@@ -125,16 +125,12 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma
        int ret;
 
        fsl_edma->txirq = platform_get_irq_byname(pdev, "edma-tx");
-       if (fsl_edma->txirq < 0) {
-               dev_err(&pdev->dev, "Can't get edma-tx irq.\n");
+       if (fsl_edma->txirq < 0)
                return fsl_edma->txirq;
-       }
 
        fsl_edma->errirq = platform_get_irq_byname(pdev, "edma-err");
-       if (fsl_edma->errirq < 0) {
-               dev_err(&pdev->dev, "Can't get edma-err irq.\n");
+       if (fsl_edma->errirq < 0)
                return fsl_edma->errirq;
-       }
 
        if (fsl_edma->txirq == fsl_edma->errirq) {
                ret = devm_request_irq(&pdev->dev, fsl_edma->txirq,
index 8e341c0..06664fb 100644 (file)
@@ -758,10 +758,8 @@ fsl_qdma_irq_init(struct platform_device *pdev,
 
        fsl_qdma->error_irq =
                platform_get_irq_byname(pdev, "qdma-error");
-       if (fsl_qdma->error_irq < 0) {
-               dev_err(&pdev->dev, "Can't get qdma controller irq.\n");
+       if (fsl_qdma->error_irq < 0)
                return fsl_qdma->error_irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, fsl_qdma->error_irq,
                               fsl_qdma_error_handler, 0,
@@ -776,11 +774,8 @@ fsl_qdma_irq_init(struct platform_device *pdev,
                fsl_qdma->queue_irq[i] =
                                platform_get_irq_byname(pdev, irq_name);
 
-               if (fsl_qdma->queue_irq[i] < 0) {
-                       dev_err(&pdev->dev,
-                               "Can't get qdma queue %d irq.\n", i);
+               if (fsl_qdma->queue_irq[i] < 0)
                        return fsl_qdma->queue_irq[i];
-               }
 
                ret = devm_request_irq(&pdev->dev,
                                       fsl_qdma->queue_irq[i],
index 546995c..f40051d 100644 (file)
@@ -547,10 +547,8 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev)
                vchan_init(&c->vc, &mtkd->ddev);
 
                rc = platform_get_irq(pdev, i);
-               if (rc < 0) {
-                       dev_err(&pdev->dev, "failed to get IRQ[%d]\n", i);
+               if (rc < 0)
                        goto err_no_dma;
-               }
                c->irq = rc;
        }
 
index 3022d66..7cb81a5 100644 (file)
@@ -183,7 +183,6 @@ static int hidma_mgmt_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
-               dev_err(&pdev->dev, "irq resources not found\n");
                rc = irq;
                goto out;
        }
index ad30f3d..43da8ee 100644 (file)
@@ -1237,11 +1237,8 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
                phy->host = s3cdma;
 
                phy->irq = platform_get_irq(pdev, i);
-               if (phy->irq < 0) {
-                       dev_err(&pdev->dev, "failed to get irq %d, err %d\n",
-                               i, phy->irq);
+               if (phy->irq < 0)
                        continue;
-               }
 
                ret = devm_request_irq(&pdev->dev, phy->irq, s3c24xx_dma_irq,
                                       0, pdev->name, phy);
index 9c41a4e..eb6f231 100644 (file)
@@ -1744,10 +1744,8 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
        /* Request the channel interrupt. */
        sprintf(pdev_irqname, "ch%u", index);
        rchan->irq = platform_get_irq_byname(pdev, pdev_irqname);
-       if (rchan->irq < 0) {
-               dev_err(dmac->dev, "no IRQ specified for channel %u\n", index);
+       if (rchan->irq < 0)
                return -ENODEV;
-       }
 
        irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u",
                                 dev_name(dmac->dev), index);
index 17063aa..b218a01 100644 (file)
@@ -717,10 +717,8 @@ static int usb_dmac_chan_probe(struct usb_dmac *dmac,
        /* Request the channel interrupt. */
        sprintf(pdev_irqname, "ch%u", index);
        uchan->irq = platform_get_irq_byname(pdev, pdev_irqname);
-       if (uchan->irq < 0) {
-               dev_err(dmac->dev, "no IRQ specified for channel %u\n", index);
+       if (uchan->irq < 0)
                return -ENODEV;
-       }
 
        irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u",
                                 dev_name(dmac->dev), index);
index a3ee0f6..67087db 100644 (file)
@@ -771,10 +771,8 @@ static int st_fdma_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, fdev);
 
        fdev->irq = platform_get_irq(pdev, 0);
-       if (fdev->irq < 0) {
-               dev_err(&pdev->dev, "Failed to get irq resource\n");
+       if (fdev->irq < 0)
                return -EINVAL;
-       }
 
        ret = devm_request_irq(&pdev->dev, fdev->irq, st_fdma_irq_handler, 0,
                               dev_name(&pdev->dev), fdev);
index ef4d109..e4cbe38 100644 (file)
@@ -1366,12 +1366,8 @@ static int stm32_dma_probe(struct platform_device *pdev)
        for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) {
                chan = &dmadev->chan[i];
                ret = platform_get_irq(pdev, i);
-               if (ret < 0)  {
-                       if (ret != -EPROBE_DEFER)
-                               dev_err(&pdev->dev,
-                                       "No irq resource for chan %d\n", i);
+               if (ret < 0)
                        goto err_unregister;
-               }
                chan->irq = ret;
 
                ret = devm_request_irq(&pdev->dev, chan->irq,
index 0d56fde..057811a 100644 (file)
@@ -1637,10 +1637,8 @@ static int stm32_mdma_probe(struct platform_device *pdev)
        }
 
        dmadev->irq = platform_get_irq(pdev, 0);
-       if (dmadev->irq < 0) {
-               dev_err(&pdev->dev, "failed to get IRQ\n");
+       if (dmadev->irq < 0)
                return dmadev->irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, dmadev->irq, stm32_mdma_irq_handler,
                               0, dev_name(&pdev->dev), dmadev);
index 1f80568..e397a50 100644 (file)
@@ -1132,10 +1132,8 @@ static int sun4i_dma_probe(struct platform_device *pdev)
                return PTR_ERR(priv->base);
 
        priv->irq = platform_get_irq(pdev, 0);
-       if (priv->irq < 0) {
-               dev_err(&pdev->dev, "Cannot claim IRQ\n");
+       if (priv->irq < 0)
                return priv->irq;
-       }
 
        priv->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(priv->clk)) {
index ed5b68d..06cd7f8 100644 (file)
@@ -1251,10 +1251,8 @@ static int sun6i_dma_probe(struct platform_device *pdev)
                return PTR_ERR(sdc->base);
 
        sdc->irq = platform_get_irq(pdev, 0);
-       if (sdc->irq < 0) {
-               dev_err(&pdev->dev, "Cannot claim IRQ\n");
+       if (sdc->irq < 0)
                return sdc->irq;
-       }
 
        sdc->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(sdc->clk)) {
index ec65a74..fde5468 100644 (file)
@@ -354,11 +354,8 @@ static int uniphier_mdmac_chan_init(struct platform_device *pdev,
        int irq, ret;
 
        irq = platform_get_irq(pdev, chan_id);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "failed to get IRQ number for ch%d\n",
-                       chan_id);
+       if (irq < 0)
                return irq;
-       }
 
        irq_name = devm_kasprintf(dev, GFP_KERNEL, "uniphier-mio-dmac-ch%d",
                                  chan_id);
index 957c269..cd60fa6 100644 (file)
@@ -1678,20 +1678,16 @@ static int xgene_dma_get_resources(struct platform_device *pdev,
 
        /* Get DMA error interrupt */
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               dev_err(&pdev->dev, "Failed to get Error IRQ\n");
+       if (irq <= 0)
                return -ENXIO;
-       }
 
        pdma->err_irq = irq;
 
        /* Get DMA Rx ring descriptor interrupts for all DMA channels */
        for (i = 1; i <= XGENE_DMA_MAX_CHANNEL; i++) {
                irq = platform_get_irq(pdev, i);
-               if (irq <= 0) {
-                       dev_err(&pdev->dev, "Failed to get Rx IRQ\n");
+               if (irq <= 0)
                        return -ENXIO;
-               }
 
                pdma->chan[i - 1].rx_irq = irq;
        }