[PATCH 01/10] dmaengine: imx-sdma: drop legacy device_node np check
Marco Felsch
m.felsch at pengutronix.de
Thu Apr 10 16:25:00 PDT 2025
On 25-04-11, Marco Felsch wrote:
> The legacy 'if (np)' was required in past where we had pdata and dt.
> Nowadays the driver binds only to dt platforms. So using a new kernel
> but still use pdata is not possible, therefore we can drop the legacy
> 'if' code path.
>
> Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
Please ignore this patch, I had issues with my mail setup.
Regards,
Marco
> ---
> drivers/dma/imx-sdma.c | 32 ++++++++++++++------------------
> 1 file changed, 14 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 3449006cd14b..699f0c6b5ae5 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -2326,11 +2326,9 @@ static int sdma_probe(struct platform_device *pdev)
> vchan_init(&sdmac->vc, &sdma->dma_device);
> }
>
> - if (np) {
> - sdma->iram_pool = of_gen_pool_get(np, "iram", 0);
> - if (sdma->iram_pool)
> - dev_info(&pdev->dev, "alloc bd from iram.\n");
> - }
> + sdma->iram_pool = of_gen_pool_get(np, "iram", 0);
> + if (sdma->iram_pool)
> + dev_info(&pdev->dev, "alloc bd from iram.\n");
>
> ret = sdma_init(sdma);
> if (ret)
> @@ -2370,21 +2368,19 @@ static int sdma_probe(struct platform_device *pdev)
> goto err_init;
> }
>
> - if (np) {
> - ret = of_dma_controller_register(np, sdma_xlate, sdma);
> - if (ret) {
> - dev_err(&pdev->dev, "failed to register controller\n");
> - goto err_register;
> - }
> + ret = of_dma_controller_register(np, sdma_xlate, sdma);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to register controller\n");
> + goto err_register;
> + }
>
> - spba_bus = of_find_compatible_node(NULL, NULL, "fsl,spba-bus");
> - ret = of_address_to_resource(spba_bus, 0, &spba_res);
> - if (!ret) {
> - sdma->spba_start_addr = spba_res.start;
> - sdma->spba_end_addr = spba_res.end;
> - }
> - of_node_put(spba_bus);
> + spba_bus = of_find_compatible_node(NULL, NULL, "fsl,spba-bus");
> + ret = of_address_to_resource(spba_bus, 0, &spba_res);
> + if (!ret) {
> + sdma->spba_start_addr = spba_res.start;
> + sdma->spba_end_addr = spba_res.end;
> }
> + of_node_put(spba_bus);
>
> /*
> * Because that device tree does not encode ROM script address,
> --
> 2.39.5
>
>
>
More information about the linux-arm-kernel
mailing list