Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Frank Li <Frank.Li@nxp.com>
To: Rob Herring <robh@kernel.org>,
	Saravana Kannan <saravanak@google.com>,
	 Vinod Koul <vkoul@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	 Sascha Hauer <s.hauer@pengutronix.de>,
	 Pengutronix Kernel Team <kernel@pengutronix.de>,
	 Fabio Estevam <festevam@gmail.com>
Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	 linux-arm-kernel@lists.infradead.org,
	Shawn Guo <shawn.guo@freescale.com>,  Frank Li <Frank.Li@nxp.com>
Subject: [PATCH v2 04/13] dmaengine: mxs-dma: Use dev_err_probe() to simplify code
Date: Thu, 15 Jan 2026 11:06:43 -0500	[thread overview]
Message-ID: <20260115-mxsdma-module-v2-4-0e1638939d03@nxp.com> (raw)
In-Reply-To: <20260115-mxsdma-module-v2-0-0e1638939d03@nxp.com>

Use dev_err_probe() simplify code. No functional change.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/dma/mxs-dma.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index dbc8747de591cc83e39ef873633418f41b5ea982..c1d4c6690df1af476aeafe77ff7f78bff1e413f1 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -753,10 +753,8 @@ static int mxs_dma_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ret = of_property_read_u32(np, "dma-channels", &mxs_dma->nr_channels);
-	if (ret) {
-		dev_err(dev, "failed to read dma-channels\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to read dma-channels\n");
 
 	dma_type = (struct mxs_dma_type *)of_device_get_match_data(dev);
 	mxs_dma->type = dma_type->type;
@@ -816,17 +814,13 @@ static int mxs_dma_probe(struct platform_device *pdev)
 	mxs_dma->dma_device.device_issue_pending = mxs_dma_enable_chan;
 
 	ret = dmaenginem_async_device_register(&mxs_dma->dma_device);
-	if (ret) {
-		dev_err(dev, "unable to register\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "unable to register\n");
 
 	ret = of_dma_controller_register(np, mxs_dma_xlate, mxs_dma);
-	if (ret) {
-		dev_err(dev,
-			"failed to register controller\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to register controller\n");
 
 	dev_info(mxs_dma->dma_device.dev, "initialized\n");
 

-- 
2.34.1


  parent reply	other threads:[~2026-01-15 16:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 16:06 [PATCH v2 00/13] dmaegnine: freescale-dmas: small improvement Frank Li
2026-01-15 16:06 ` [PATCH v2 01/13] dmaengine: of_dma: Add devm_of_dma_controller_register() Frank Li
2026-01-15 16:06 ` [PATCH v2 02/13] dmaengine: mxs-dma: Fix missing return value from of_dma_controller_register() Frank Li
2026-01-15 16:06 ` [PATCH v2 03/13] dmaengine: mxs-dma: Use local dev variable in probe() Frank Li
2026-01-15 16:06 ` Frank Li [this message]
2026-01-15 16:06 ` [PATCH v2 05/13] dmaengine: mxs-dma: Use managed API devm_of_dma_controller_register() Frank Li
2026-01-15 16:06 ` [PATCH v2 06/13] dmaengine: mxs-dma: Add module license and description Frank Li
2026-01-15 16:06 ` [PATCH v2 07/13] dmaengine: mxs-dma: Turn MXS_DMA as tristate Frank Li
2026-01-15 16:06 ` [PATCH v2 08/13] dmaengine: imx-sdma: Use devm_clk_get_prepared() to simplify code Frank Li
2026-01-15 16:06 ` [PATCH v2 09/13] dmaengine: imx-sdma: Use managed API " Frank Li
2026-01-15 16:06 ` [PATCH v2 10/13] dmaengine: imx-sdma: Use dev_err_probe() " Frank Li
2026-01-15 16:06 ` [PATCH v2 11/13] dmaengine: fsl-edma: Use managed API dmaenginem_async_device_register() Frank Li
2026-01-15 16:06 ` [PATCH v2 12/13] dmaengine: fsl-edma: Use dev_err_probe() to simplify code Frank Li
2026-01-15 16:06 ` [PATCH v2 13/13] dmaengine: fsl-qdma: " Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260115-mxsdma-module-v2-4-0e1638939d03@nxp.com \
    --to=frank.li@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=saravanak@google.com \
    --cc=shawn.guo@freescale.com \
    --cc=shawnguo@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox