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 02/13] dmaengine: mxs-dma: Use local dev variable in probe()
Date: Wed, 14 Jan 2026 17:33:14 -0500 [thread overview]
Message-ID: <20260114-mxsdma-module-v1-2-9b2a9eaa4226@nxp.com> (raw)
In-Reply-To: <20260114-mxsdma-module-v1-0-9b2a9eaa4226@nxp.com>
Introduce a local dev variable in probe() to avoid repeated use of
&pdev->dev throughout the function.
No functional change.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/dma/mxs-dma.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index cfb9962417ef68e976ae03c3c6f3054dc89bd1e6..c7e535c91469f0d819d6fe7465725736dc6128d8 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -744,20 +744,21 @@ static int mxs_dma_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
const struct mxs_dma_type *dma_type;
+ struct device *dev = &pdev->dev;
struct mxs_dma_engine *mxs_dma;
int ret, i;
- mxs_dma = devm_kzalloc(&pdev->dev, sizeof(*mxs_dma), GFP_KERNEL);
+ mxs_dma = devm_kzalloc(dev, sizeof(*mxs_dma), GFP_KERNEL);
if (!mxs_dma)
return -ENOMEM;
ret = of_property_read_u32(np, "dma-channels", &mxs_dma->nr_channels);
if (ret) {
- dev_err(&pdev->dev, "failed to read dma-channels\n");
+ dev_err(dev, "failed to read dma-channels\n");
return ret;
}
- dma_type = (struct mxs_dma_type *)of_device_get_match_data(&pdev->dev);
+ dma_type = (struct mxs_dma_type *)of_device_get_match_data(dev);
mxs_dma->type = dma_type->type;
mxs_dma->dev_id = dma_type->id;
@@ -765,7 +766,7 @@ static int mxs_dma_probe(struct platform_device *pdev)
if (IS_ERR(mxs_dma->base))
return PTR_ERR(mxs_dma->base);
- mxs_dma->clk = devm_clk_get(&pdev->dev, NULL);
+ mxs_dma->clk = devm_clk_get(dev, NULL);
if (IS_ERR(mxs_dma->clk))
return PTR_ERR(mxs_dma->clk);
@@ -795,7 +796,7 @@ static int mxs_dma_probe(struct platform_device *pdev)
return ret;
mxs_dma->pdev = pdev;
- mxs_dma->dma_device.dev = &pdev->dev;
+ mxs_dma->dma_device.dev = dev;
/* mxs_dma gets 65535 bytes maximum sg size */
dma_set_max_seg_size(mxs_dma->dma_device.dev, MAX_XFER_BYTES);
@@ -816,13 +817,13 @@ static int mxs_dma_probe(struct platform_device *pdev)
ret = dmaenginem_async_device_register(&mxs_dma->dma_device);
if (ret) {
- dev_err(mxs_dma->dma_device.dev, "unable to register\n");
+ dev_err(dev, "unable to register\n");
return ret;
}
ret = of_dma_controller_register(np, mxs_dma_xlate, mxs_dma);
if (ret) {
- dev_err(mxs_dma->dma_device.dev,
+ dev_err(dev,
"failed to register controller\n");
}
--
2.34.1
next prev parent reply other threads:[~2026-01-14 22:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 22:33 [PATCH 00/13] dmaegnine: freescale-dmas: small improvement Frank Li
2026-01-14 22:33 ` [PATCH 01/13] dmaengine: of_dma: Add devm_of_dma_controller_register() Frank Li
2026-01-15 8:44 ` Daniel Baluta
2026-01-15 10:45 ` kernel test robot
2026-01-15 11:29 ` kernel test robot
2026-01-14 22:33 ` Frank Li [this message]
2026-01-14 23:27 ` [PATCH 02/13] dmaengine: mxs-dma: Use local dev variable in probe() Fabio Estevam
2026-01-15 14:35 ` Frank Li
2026-01-14 22:33 ` [PATCH 03/13] dmaengine: mxs-dma: Fix missing return value from of_dma_controller_register() Frank Li
2026-01-15 8:45 ` Daniel Baluta
2026-01-14 22:33 ` [PATCH 04/13] dmaengine: mxs-dma: Use dev_err_probe() simple code Frank Li
2026-01-14 22:33 ` [PATCH 05/13] dmaengine: mxs-dma: Use managed API devm_of_dma_controller_register() Frank Li
2026-01-14 22:33 ` [PATCH 06/13] dmaengine: mxs-dma: Add module license and description Frank Li
2026-01-14 22:33 ` [PATCH 07/13] dmaengine: mxs-dma: Turn MXS_DMA as tristate Frank Li
2026-01-14 22:33 ` [PATCH 08/13] dmaengine: fsl-edma: Use managed API dmaenginem_async_device_register() Frank Li
2026-01-14 22:33 ` [PATCH 09/13] dmaengine: fsl-edma: Use dev_err_probe() to simplify code Frank Li
2026-01-14 22:33 ` [PATCH 10/13] dmaengine: imx-sdma: Use devm_clk_get_prepared() " Frank Li
2026-01-14 22:33 ` [PATCH 11/13] dmaengine: imx-sdma: Use managed API " Frank Li
2026-01-14 22:33 ` [PATCH 12/13] dmaengine: imx-sdma: Use dev_err_probe() " Frank Li
2026-01-14 22:33 ` [PATCH 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=20260114-mxsdma-module-v1-2-9b2a9eaa4226@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