mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
dmaengine: mxs-dma: Use local dev variable in probe()
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> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-3-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
@@ -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,10 +796,10 @@ 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);
|
||||
dma_set_max_seg_size(dev, MAX_XFER_BYTES);
|
||||
|
||||
mxs_dma->dma_device.device_alloc_chan_resources = mxs_dma_alloc_chan_resources;
|
||||
mxs_dma->dma_device.device_free_chan_resources = mxs_dma_free_chan_resources;
|
||||
@@ -816,18 +817,18 @@ 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;
|
||||
}
|
||||
|
||||
dev_info(mxs_dma->dma_device.dev, "initialized\n");
|
||||
dev_info(dev, "initialized\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user