* [PATCH] dmaengine: mxs-dma: Remove the unused .id_table
@ 2020-11-23 19:30 Fabio Estevam
2020-11-24 17:28 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2020-11-23 19:30 UTC (permalink / raw)
To: vkoul; +Cc: kernel, dmaengine, Fabio Estevam
The mxs-dma driver is only used by DT platforms and the .id_table
is unused.
Get rid of it to simplify the code.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
drivers/dma/mxs-dma.c | 37 +++++--------------------------------
1 file changed, 5 insertions(+), 32 deletions(-)
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 65f816b40c32..994fc4d2aca4 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -167,29 +167,11 @@ static struct mxs_dma_type mxs_dma_types[] = {
}
};
-static const struct platform_device_id mxs_dma_ids[] = {
- {
- .name = "imx23-dma-apbh",
- .driver_data = (kernel_ulong_t) &mxs_dma_types[0],
- }, {
- .name = "imx23-dma-apbx",
- .driver_data = (kernel_ulong_t) &mxs_dma_types[1],
- }, {
- .name = "imx28-dma-apbh",
- .driver_data = (kernel_ulong_t) &mxs_dma_types[2],
- }, {
- .name = "imx28-dma-apbx",
- .driver_data = (kernel_ulong_t) &mxs_dma_types[3],
- }, {
- /* end of list */
- }
-};
-
static const struct of_device_id mxs_dma_dt_ids[] = {
- { .compatible = "fsl,imx23-dma-apbh", .data = &mxs_dma_ids[0], },
- { .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_ids[1], },
- { .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_ids[2], },
- { .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_ids[3], },
+ { .compatible = "fsl,imx23-dma-apbh", .data = &mxs_dma_types[0], },
+ { .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_types[1], },
+ { .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_types[2], },
+ { .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_types[3], },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mxs_dma_dt_ids);
@@ -762,8 +744,6 @@ static struct dma_chan *mxs_dma_xlate(struct of_phandle_args *dma_spec,
static int __init mxs_dma_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
- const struct platform_device_id *id_entry;
- const struct of_device_id *of_id;
const struct mxs_dma_type *dma_type;
struct mxs_dma_engine *mxs_dma;
struct resource *iores;
@@ -779,13 +759,7 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
return ret;
}
- of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev);
- if (of_id)
- id_entry = of_id->data;
- else
- id_entry = platform_get_device_id(pdev);
-
- dma_type = (struct mxs_dma_type *)id_entry->driver_data;
+ dma_type = (struct mxs_dma_type *)of_device_get_match_data(&pdev->dev);
mxs_dma->type = dma_type->type;
mxs_dma->dev_id = dma_type->id;
@@ -865,7 +839,6 @@ static struct platform_driver mxs_dma_driver = {
.name = "mxs-dma",
.of_match_table = mxs_dma_dt_ids,
},
- .id_table = mxs_dma_ids,
};
static int __init mxs_dma_module_init(void)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] dmaengine: mxs-dma: Remove the unused .id_table
2020-11-23 19:30 [PATCH] dmaengine: mxs-dma: Remove the unused .id_table Fabio Estevam
@ 2020-11-24 17:28 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-11-24 17:28 UTC (permalink / raw)
To: Fabio Estevam; +Cc: kernel, dmaengine
On 23-11-20, 16:30, Fabio Estevam wrote:
> The mxs-dma driver is only used by DT platforms and the .id_table
> is unused.
Applied, thanks
>
> Get rid of it to simplify the code.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> drivers/dma/mxs-dma.c | 37 +++++--------------------------------
> 1 file changed, 5 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> index 65f816b40c32..994fc4d2aca4 100644
> --- a/drivers/dma/mxs-dma.c
> +++ b/drivers/dma/mxs-dma.c
> @@ -167,29 +167,11 @@ static struct mxs_dma_type mxs_dma_types[] = {
> }
> };
>
> -static const struct platform_device_id mxs_dma_ids[] = {
> - {
> - .name = "imx23-dma-apbh",
> - .driver_data = (kernel_ulong_t) &mxs_dma_types[0],
> - }, {
> - .name = "imx23-dma-apbx",
> - .driver_data = (kernel_ulong_t) &mxs_dma_types[1],
> - }, {
> - .name = "imx28-dma-apbh",
> - .driver_data = (kernel_ulong_t) &mxs_dma_types[2],
> - }, {
> - .name = "imx28-dma-apbx",
> - .driver_data = (kernel_ulong_t) &mxs_dma_types[3],
> - }, {
> - /* end of list */
> - }
> -};
> -
> static const struct of_device_id mxs_dma_dt_ids[] = {
> - { .compatible = "fsl,imx23-dma-apbh", .data = &mxs_dma_ids[0], },
> - { .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_ids[1], },
> - { .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_ids[2], },
> - { .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_ids[3], },
> + { .compatible = "fsl,imx23-dma-apbh", .data = &mxs_dma_types[0], },
> + { .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_types[1], },
> + { .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_types[2], },
> + { .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_types[3], },
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, mxs_dma_dt_ids);
> @@ -762,8 +744,6 @@ static struct dma_chan *mxs_dma_xlate(struct of_phandle_args *dma_spec,
> static int __init mxs_dma_probe(struct platform_device *pdev)
> {
> struct device_node *np = pdev->dev.of_node;
> - const struct platform_device_id *id_entry;
> - const struct of_device_id *of_id;
> const struct mxs_dma_type *dma_type;
> struct mxs_dma_engine *mxs_dma;
> struct resource *iores;
> @@ -779,13 +759,7 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
> return ret;
> }
>
> - of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev);
> - if (of_id)
> - id_entry = of_id->data;
> - else
> - id_entry = platform_get_device_id(pdev);
> -
> - dma_type = (struct mxs_dma_type *)id_entry->driver_data;
> + dma_type = (struct mxs_dma_type *)of_device_get_match_data(&pdev->dev);
> mxs_dma->type = dma_type->type;
> mxs_dma->dev_id = dma_type->id;
>
> @@ -865,7 +839,6 @@ static struct platform_driver mxs_dma_driver = {
> .name = "mxs-dma",
> .of_match_table = mxs_dma_dt_ids,
> },
> - .id_table = mxs_dma_ids,
> };
>
> static int __init mxs_dma_module_init(void)
> --
> 2.17.1
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-24 17:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-23 19:30 [PATCH] dmaengine: mxs-dma: Remove the unused .id_table Fabio Estevam
2020-11-24 17:28 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox