From a67ba97dfb30486deb4661f770b954387acc898d Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 6 Oct 2023 16:38:43 -0500 Subject: dmaengine: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006213844.333027-1-robh@kernel.org Signed-off-by: Vinod Koul --- drivers/dma/mmp_tdma.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'drivers/dma/mmp_tdma.c') diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index fbde35688121..9fff54b12db7 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -14,9 +14,9 @@ #include #include #include +#include #include #include -#include #include #include "dmaengine.h" @@ -642,11 +642,7 @@ static int mmp_tdma_probe(struct platform_device *pdev) int chan_num = TDMA_CHANNEL_NUM; struct gen_pool *pool = NULL; - of_id = of_match_device(mmp_tdma_dt_ids, &pdev->dev); - if (of_id) - type = (uintptr_t) of_id->data; - else - type = platform_get_device_id(pdev)->driver_data; + type = (enum mmp_tdma_type)device_get_match_data(&pdev->dev); /* always have couple channels */ tdev = devm_kzalloc(&pdev->dev, sizeof(*tdev), GFP_KERNEL); @@ -724,32 +720,22 @@ static int mmp_tdma_probe(struct platform_device *pdev) return ret; } - if (pdev->dev.of_node) { - ret = of_dma_controller_register(pdev->dev.of_node, - mmp_tdma_xlate, tdev); - if (ret) { - dev_err(tdev->device.dev, - "failed to register controller\n"); - return ret; - } + ret = of_dma_controller_register(pdev->dev.of_node, + mmp_tdma_xlate, tdev); + if (ret) { + dev_err(tdev->device.dev, "failed to register controller\n"); + return ret; } dev_info(tdev->device.dev, "initialized\n"); return 0; } -static const struct platform_device_id mmp_tdma_id_table[] = { - { "mmp-adma", MMP_AUD_TDMA }, - { "pxa910-squ", PXA910_SQU }, - { }, -}; - static struct platform_driver mmp_tdma_driver = { .driver = { .name = "mmp-tdma", .of_match_table = mmp_tdma_dt_ids, }, - .id_table = mmp_tdma_id_table, .probe = mmp_tdma_probe, .remove_new = mmp_tdma_remove, }; -- cgit