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

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.org


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 7f5d7425
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;

+2 −6
Original line number Diff line number Diff line
@@ -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,
+2 −7
Original line number Diff line number Diff line
@@ -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],
+1 −3
Original line number Diff line number Diff line
@@ -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;
	}

+0 −1
Original line number Diff line number Diff line
@@ -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;
	}
Loading