|
14 | 14 | #include <linux/slab.h> |
15 | 15 | #include <linux/dmaengine.h> |
16 | 16 | #include <linux/platform_device.h> |
| 17 | +#include <linux/property.h> |
17 | 18 | #include <linux/device.h> |
18 | 19 | #include <linux/genalloc.h> |
19 | | -#include <linux/of_device.h> |
20 | 20 | #include <linux/of_dma.h> |
21 | 21 |
|
22 | 22 | #include "dmaengine.h" |
@@ -642,11 +642,7 @@ static int mmp_tdma_probe(struct platform_device *pdev) |
642 | 642 | int chan_num = TDMA_CHANNEL_NUM; |
643 | 643 | struct gen_pool *pool = NULL; |
644 | 644 |
|
645 | | - of_id = of_match_device(mmp_tdma_dt_ids, &pdev->dev); |
646 | | - if (of_id) |
647 | | - type = (uintptr_t) of_id->data; |
648 | | - else |
649 | | - type = platform_get_device_id(pdev)->driver_data; |
| 645 | + type = (enum mmp_tdma_type)device_get_match_data(&pdev->dev); |
650 | 646 |
|
651 | 647 | /* always have couple channels */ |
652 | 648 | tdev = devm_kzalloc(&pdev->dev, sizeof(*tdev), GFP_KERNEL); |
@@ -724,32 +720,22 @@ static int mmp_tdma_probe(struct platform_device *pdev) |
724 | 720 | return ret; |
725 | 721 | } |
726 | 722 |
|
727 | | - if (pdev->dev.of_node) { |
728 | | - ret = of_dma_controller_register(pdev->dev.of_node, |
729 | | - mmp_tdma_xlate, tdev); |
730 | | - if (ret) { |
731 | | - dev_err(tdev->device.dev, |
732 | | - "failed to register controller\n"); |
733 | | - return ret; |
734 | | - } |
| 723 | + ret = of_dma_controller_register(pdev->dev.of_node, |
| 724 | + mmp_tdma_xlate, tdev); |
| 725 | + if (ret) { |
| 726 | + dev_err(tdev->device.dev, "failed to register controller\n"); |
| 727 | + return ret; |
735 | 728 | } |
736 | 729 |
|
737 | 730 | dev_info(tdev->device.dev, "initialized\n"); |
738 | 731 | return 0; |
739 | 732 | } |
740 | 733 |
|
741 | | -static const struct platform_device_id mmp_tdma_id_table[] = { |
742 | | - { "mmp-adma", MMP_AUD_TDMA }, |
743 | | - { "pxa910-squ", PXA910_SQU }, |
744 | | - { }, |
745 | | -}; |
746 | | - |
747 | 734 | static struct platform_driver mmp_tdma_driver = { |
748 | 735 | .driver = { |
749 | 736 | .name = "mmp-tdma", |
750 | 737 | .of_match_table = mmp_tdma_dt_ids, |
751 | 738 | }, |
752 | | - .id_table = mmp_tdma_id_table, |
753 | 739 | .probe = mmp_tdma_probe, |
754 | 740 | .remove_new = mmp_tdma_remove, |
755 | 741 | }; |
|
0 commit comments