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 03/13] dmaengine: mxs-dma: Use local dev variable in probe()
Date: Thu, 15 Jan 2026 11:06:42 -0500 [thread overview]
Message-ID: <20260115-mxsdma-module-v2-3-0e1638939d03@nxp.com> (raw)
In-Reply-To: <20260115-mxsdma-module-v2-0-0e1638939d03@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 53f572b6b6fc62c6cb2496f0da281887f8fc3280..dbc8747de591cc83e39ef873633418f41b5ea982 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");
return ret;
}
--
2.34.1
next prev 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 ` Frank Li [this message]
2026-01-15 16:06 ` [PATCH v2 04/13] dmaengine: mxs-dma: Use dev_err_probe() to simplify code Frank Li
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-3-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