Commit e17be6e1 authored by Stephen Boyd's avatar Stephen Boyd Committed by Vinod Koul

dmaengine: 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).

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: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-11-swboyd@chromium.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 7f5d7425
...@@ -886,10 +886,8 @@ static int jz4780_dma_probe(struct platform_device *pdev) ...@@ -886,10 +886,8 @@ static int jz4780_dma_probe(struct platform_device *pdev)
} }
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(dev, "failed to get IRQ: %d\n", ret);
return ret; return ret;
}
jzdma->irq = ret; jzdma->irq = ret;
......
...@@ -125,16 +125,12 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma ...@@ -125,16 +125,12 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma
int ret; int ret;
fsl_edma->txirq = platform_get_irq_byname(pdev, "edma-tx"); fsl_edma->txirq = platform_get_irq_byname(pdev, "edma-tx");
if (fsl_edma->txirq < 0) { if (fsl_edma->txirq < 0)
dev_err(&pdev->dev, "Can't get edma-tx irq.\n");
return fsl_edma->txirq; return fsl_edma->txirq;
}
fsl_edma->errirq = platform_get_irq_byname(pdev, "edma-err"); fsl_edma->errirq = platform_get_irq_byname(pdev, "edma-err");
if (fsl_edma->errirq < 0) { if (fsl_edma->errirq < 0)
dev_err(&pdev->dev, "Can't get edma-err irq.\n");
return fsl_edma->errirq; return fsl_edma->errirq;
}
if (fsl_edma->txirq == fsl_edma->errirq) { if (fsl_edma->txirq == fsl_edma->errirq) {
ret = devm_request_irq(&pdev->dev, fsl_edma->txirq, ret = devm_request_irq(&pdev->dev, fsl_edma->txirq,
......
...@@ -758,10 +758,8 @@ fsl_qdma_irq_init(struct platform_device *pdev, ...@@ -758,10 +758,8 @@ fsl_qdma_irq_init(struct platform_device *pdev,
fsl_qdma->error_irq = fsl_qdma->error_irq =
platform_get_irq_byname(pdev, "qdma-error"); platform_get_irq_byname(pdev, "qdma-error");
if (fsl_qdma->error_irq < 0) { if (fsl_qdma->error_irq < 0)
dev_err(&pdev->dev, "Can't get qdma controller irq.\n");
return fsl_qdma->error_irq; return fsl_qdma->error_irq;
}
ret = devm_request_irq(&pdev->dev, fsl_qdma->error_irq, ret = devm_request_irq(&pdev->dev, fsl_qdma->error_irq,
fsl_qdma_error_handler, 0, fsl_qdma_error_handler, 0,
...@@ -776,11 +774,8 @@ fsl_qdma_irq_init(struct platform_device *pdev, ...@@ -776,11 +774,8 @@ fsl_qdma_irq_init(struct platform_device *pdev,
fsl_qdma->queue_irq[i] = fsl_qdma->queue_irq[i] =
platform_get_irq_byname(pdev, irq_name); platform_get_irq_byname(pdev, irq_name);
if (fsl_qdma->queue_irq[i] < 0) { if (fsl_qdma->queue_irq[i] < 0)
dev_err(&pdev->dev,
"Can't get qdma queue %d irq.\n", i);
return fsl_qdma->queue_irq[i]; return fsl_qdma->queue_irq[i];
}
ret = devm_request_irq(&pdev->dev, ret = devm_request_irq(&pdev->dev,
fsl_qdma->queue_irq[i], fsl_qdma->queue_irq[i],
......
...@@ -547,10 +547,8 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev) ...@@ -547,10 +547,8 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev)
vchan_init(&c->vc, &mtkd->ddev); vchan_init(&c->vc, &mtkd->ddev);
rc = platform_get_irq(pdev, i); rc = platform_get_irq(pdev, i);
if (rc < 0) { if (rc < 0)
dev_err(&pdev->dev, "failed to get IRQ[%d]\n", i);
goto err_no_dma; goto err_no_dma;
}
c->irq = rc; c->irq = rc;
} }
......
...@@ -183,7 +183,6 @@ static int hidma_mgmt_probe(struct platform_device *pdev) ...@@ -183,7 +183,6 @@ static int hidma_mgmt_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "irq resources not found\n");
rc = irq; rc = irq;
goto out; goto out;
} }
......
...@@ -1237,11 +1237,8 @@ static int s3c24xx_dma_probe(struct platform_device *pdev) ...@@ -1237,11 +1237,8 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
phy->host = s3cdma; phy->host = s3cdma;
phy->irq = platform_get_irq(pdev, i); phy->irq = platform_get_irq(pdev, i);
if (phy->irq < 0) { if (phy->irq < 0)
dev_err(&pdev->dev, "failed to get irq %d, err %d\n",
i, phy->irq);
continue; continue;
}
ret = devm_request_irq(&pdev->dev, phy->irq, s3c24xx_dma_irq, ret = devm_request_irq(&pdev->dev, phy->irq, s3c24xx_dma_irq,
0, pdev->name, phy); 0, pdev->name, phy);
......
...@@ -1744,10 +1744,8 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac, ...@@ -1744,10 +1744,8 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
/* Request the channel interrupt. */ /* Request the channel interrupt. */
sprintf(pdev_irqname, "ch%u", index); sprintf(pdev_irqname, "ch%u", index);
rchan->irq = platform_get_irq_byname(pdev, pdev_irqname); rchan->irq = platform_get_irq_byname(pdev, pdev_irqname);
if (rchan->irq < 0) { if (rchan->irq < 0)
dev_err(dmac->dev, "no IRQ specified for channel %u\n", index);
return -ENODEV; return -ENODEV;
}
irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u", irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u",
dev_name(dmac->dev), index); dev_name(dmac->dev), index);
......
...@@ -717,10 +717,8 @@ static int usb_dmac_chan_probe(struct usb_dmac *dmac, ...@@ -717,10 +717,8 @@ static int usb_dmac_chan_probe(struct usb_dmac *dmac,
/* Request the channel interrupt. */ /* Request the channel interrupt. */
sprintf(pdev_irqname, "ch%u", index); sprintf(pdev_irqname, "ch%u", index);
uchan->irq = platform_get_irq_byname(pdev, pdev_irqname); uchan->irq = platform_get_irq_byname(pdev, pdev_irqname);
if (uchan->irq < 0) { if (uchan->irq < 0)
dev_err(dmac->dev, "no IRQ specified for channel %u\n", index);
return -ENODEV; return -ENODEV;
}
irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u", irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u",
dev_name(dmac->dev), index); dev_name(dmac->dev), index);
......
...@@ -771,10 +771,8 @@ static int st_fdma_probe(struct platform_device *pdev) ...@@ -771,10 +771,8 @@ static int st_fdma_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, fdev); platform_set_drvdata(pdev, fdev);
fdev->irq = platform_get_irq(pdev, 0); fdev->irq = platform_get_irq(pdev, 0);
if (fdev->irq < 0) { if (fdev->irq < 0)
dev_err(&pdev->dev, "Failed to get irq resource\n");
return -EINVAL; return -EINVAL;
}
ret = devm_request_irq(&pdev->dev, fdev->irq, st_fdma_irq_handler, 0, ret = devm_request_irq(&pdev->dev, fdev->irq, st_fdma_irq_handler, 0,
dev_name(&pdev->dev), fdev); dev_name(&pdev->dev), fdev);
......
...@@ -1366,12 +1366,8 @@ static int stm32_dma_probe(struct platform_device *pdev) ...@@ -1366,12 +1366,8 @@ static int stm32_dma_probe(struct platform_device *pdev)
for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) { for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) {
chan = &dmadev->chan[i]; chan = &dmadev->chan[i];
ret = platform_get_irq(pdev, i); ret = platform_get_irq(pdev, i);
if (ret < 0) { if (ret < 0)
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev,
"No irq resource for chan %d\n", i);
goto err_unregister; goto err_unregister;
}
chan->irq = ret; chan->irq = ret;
ret = devm_request_irq(&pdev->dev, chan->irq, ret = devm_request_irq(&pdev->dev, chan->irq,
......
...@@ -1637,10 +1637,8 @@ static int stm32_mdma_probe(struct platform_device *pdev) ...@@ -1637,10 +1637,8 @@ static int stm32_mdma_probe(struct platform_device *pdev)
} }
dmadev->irq = platform_get_irq(pdev, 0); dmadev->irq = platform_get_irq(pdev, 0);
if (dmadev->irq < 0) { if (dmadev->irq < 0)
dev_err(&pdev->dev, "failed to get IRQ\n");
return dmadev->irq; return dmadev->irq;
}
ret = devm_request_irq(&pdev->dev, dmadev->irq, stm32_mdma_irq_handler, ret = devm_request_irq(&pdev->dev, dmadev->irq, stm32_mdma_irq_handler,
0, dev_name(&pdev->dev), dmadev); 0, dev_name(&pdev->dev), dmadev);
......
...@@ -1132,10 +1132,8 @@ static int sun4i_dma_probe(struct platform_device *pdev) ...@@ -1132,10 +1132,8 @@ static int sun4i_dma_probe(struct platform_device *pdev)
return PTR_ERR(priv->base); return PTR_ERR(priv->base);
priv->irq = platform_get_irq(pdev, 0); priv->irq = platform_get_irq(pdev, 0);
if (priv->irq < 0) { if (priv->irq < 0)
dev_err(&pdev->dev, "Cannot claim IRQ\n");
return priv->irq; return priv->irq;
}
priv->clk = devm_clk_get(&pdev->dev, NULL); priv->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(priv->clk)) { if (IS_ERR(priv->clk)) {
......
...@@ -1251,10 +1251,8 @@ static int sun6i_dma_probe(struct platform_device *pdev) ...@@ -1251,10 +1251,8 @@ static int sun6i_dma_probe(struct platform_device *pdev)
return PTR_ERR(sdc->base); return PTR_ERR(sdc->base);
sdc->irq = platform_get_irq(pdev, 0); sdc->irq = platform_get_irq(pdev, 0);
if (sdc->irq < 0) { if (sdc->irq < 0)
dev_err(&pdev->dev, "Cannot claim IRQ\n");
return sdc->irq; return sdc->irq;
}
sdc->clk = devm_clk_get(&pdev->dev, NULL); sdc->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(sdc->clk)) { if (IS_ERR(sdc->clk)) {
......
...@@ -354,11 +354,8 @@ static int uniphier_mdmac_chan_init(struct platform_device *pdev, ...@@ -354,11 +354,8 @@ static int uniphier_mdmac_chan_init(struct platform_device *pdev,
int irq, ret; int irq, ret;
irq = platform_get_irq(pdev, chan_id); irq = platform_get_irq(pdev, chan_id);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "failed to get IRQ number for ch%d\n",
chan_id);
return irq; return irq;
}
irq_name = devm_kasprintf(dev, GFP_KERNEL, "uniphier-mio-dmac-ch%d", irq_name = devm_kasprintf(dev, GFP_KERNEL, "uniphier-mio-dmac-ch%d",
chan_id); chan_id);
......
...@@ -1678,20 +1678,16 @@ static int xgene_dma_get_resources(struct platform_device *pdev, ...@@ -1678,20 +1678,16 @@ static int xgene_dma_get_resources(struct platform_device *pdev,
/* Get DMA error interrupt */ /* Get DMA error interrupt */
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0)
dev_err(&pdev->dev, "Failed to get Error IRQ\n");
return -ENXIO; return -ENXIO;
}
pdma->err_irq = irq; pdma->err_irq = irq;
/* Get DMA Rx ring descriptor interrupts for all DMA channels */ /* Get DMA Rx ring descriptor interrupts for all DMA channels */
for (i = 1; i <= XGENE_DMA_MAX_CHANNEL; i++) { for (i = 1; i <= XGENE_DMA_MAX_CHANNEL; i++) {
irq = platform_get_irq(pdev, i); irq = platform_get_irq(pdev, i);
if (irq <= 0) { if (irq <= 0)
dev_err(&pdev->dev, "Failed to get Rx IRQ\n");
return -ENXIO; return -ENXIO;
}
pdma->chan[i - 1].rx_irq = irq; pdma->chan[i - 1].rx_irq = irq;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment