diff options
author | Daniel Mack <zonque@gmail.com> | 2013-09-22 10:50:02 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-10-06 22:11:39 -0400 |
commit | 717d818169e5d5672fb81bc7357e9bb265d1e228 (patch) | |
tree | 47bb803d061ac4928170d373607f012f589720e4 | |
parent | b46ce4d01e1c6052809b13340cc8e62d361f7306 (diff) |
dma: cppi41: add shortcut to &pdev->dev in cppi41_dma_probe()
Makes the code more readable and compact. No functional change.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/cppi41.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 5469a15c7f8f..d6897067e4cd 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c | |||
@@ -927,11 +927,12 @@ static const struct cppi_glue_infos *get_glue_info(struct device *dev) | |||
927 | static int cppi41_dma_probe(struct platform_device *pdev) | 927 | static int cppi41_dma_probe(struct platform_device *pdev) |
928 | { | 928 | { |
929 | struct cppi41_dd *cdd; | 929 | struct cppi41_dd *cdd; |
930 | struct device *dev = &pdev->dev; | ||
930 | const struct cppi_glue_infos *glue_info; | 931 | const struct cppi_glue_infos *glue_info; |
931 | int irq; | 932 | int irq; |
932 | int ret; | 933 | int ret; |
933 | 934 | ||
934 | glue_info = get_glue_info(&pdev->dev); | 935 | glue_info = get_glue_info(dev); |
935 | if (!glue_info) | 936 | if (!glue_info) |
936 | return -EINVAL; | 937 | return -EINVAL; |
937 | 938 | ||
@@ -946,14 +947,14 @@ static int cppi41_dma_probe(struct platform_device *pdev) | |||
946 | cdd->ddev.device_issue_pending = cppi41_dma_issue_pending; | 947 | cdd->ddev.device_issue_pending = cppi41_dma_issue_pending; |
947 | cdd->ddev.device_prep_slave_sg = cppi41_dma_prep_slave_sg; | 948 | cdd->ddev.device_prep_slave_sg = cppi41_dma_prep_slave_sg; |
948 | cdd->ddev.device_control = cppi41_dma_control; | 949 | cdd->ddev.device_control = cppi41_dma_control; |
949 | cdd->ddev.dev = &pdev->dev; | 950 | cdd->ddev.dev = dev; |
950 | INIT_LIST_HEAD(&cdd->ddev.channels); | 951 | INIT_LIST_HEAD(&cdd->ddev.channels); |
951 | cpp41_dma_info.dma_cap = cdd->ddev.cap_mask; | 952 | cpp41_dma_info.dma_cap = cdd->ddev.cap_mask; |
952 | 953 | ||
953 | cdd->usbss_mem = of_iomap(pdev->dev.of_node, 0); | 954 | cdd->usbss_mem = of_iomap(dev->of_node, 0); |
954 | cdd->ctrl_mem = of_iomap(pdev->dev.of_node, 1); | 955 | cdd->ctrl_mem = of_iomap(dev->of_node, 1); |
955 | cdd->sched_mem = of_iomap(pdev->dev.of_node, 2); | 956 | cdd->sched_mem = of_iomap(dev->of_node, 2); |
956 | cdd->qmgr_mem = of_iomap(pdev->dev.of_node, 3); | 957 | cdd->qmgr_mem = of_iomap(dev->of_node, 3); |
957 | 958 | ||
958 | if (!cdd->usbss_mem || !cdd->ctrl_mem || !cdd->sched_mem || | 959 | if (!cdd->usbss_mem || !cdd->ctrl_mem || !cdd->sched_mem || |
959 | !cdd->qmgr_mem) { | 960 | !cdd->qmgr_mem) { |
@@ -961,8 +962,8 @@ static int cppi41_dma_probe(struct platform_device *pdev) | |||
961 | goto err_remap; | 962 | goto err_remap; |
962 | } | 963 | } |
963 | 964 | ||
964 | pm_runtime_enable(&pdev->dev); | 965 | pm_runtime_enable(dev); |
965 | ret = pm_runtime_get_sync(&pdev->dev); | 966 | ret = pm_runtime_get_sync(dev); |
966 | if (ret) | 967 | if (ret) |
967 | goto err_get_sync; | 968 | goto err_get_sync; |
968 | 969 | ||
@@ -970,22 +971,22 @@ static int cppi41_dma_probe(struct platform_device *pdev) | |||
970 | cdd->queues_tx = glue_info->queues_tx; | 971 | cdd->queues_tx = glue_info->queues_tx; |
971 | cdd->td_queue = glue_info->td_queue; | 972 | cdd->td_queue = glue_info->td_queue; |
972 | 973 | ||
973 | ret = init_cppi41(&pdev->dev, cdd); | 974 | ret = init_cppi41(dev, cdd); |
974 | if (ret) | 975 | if (ret) |
975 | goto err_init_cppi; | 976 | goto err_init_cppi; |
976 | 977 | ||
977 | ret = cppi41_add_chans(&pdev->dev, cdd); | 978 | ret = cppi41_add_chans(dev, cdd); |
978 | if (ret) | 979 | if (ret) |
979 | goto err_chans; | 980 | goto err_chans; |
980 | 981 | ||
981 | irq = irq_of_parse_and_map(pdev->dev.of_node, 0); | 982 | irq = irq_of_parse_and_map(dev->of_node, 0); |
982 | if (!irq) | 983 | if (!irq) |
983 | goto err_irq; | 984 | goto err_irq; |
984 | 985 | ||
985 | cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER); | 986 | cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER); |
986 | 987 | ||
987 | ret = request_irq(irq, glue_info->isr, IRQF_SHARED, | 988 | ret = request_irq(irq, glue_info->isr, IRQF_SHARED, |
988 | dev_name(&pdev->dev), cdd); | 989 | dev_name(dev), cdd); |
989 | if (ret) | 990 | if (ret) |
990 | goto err_irq; | 991 | goto err_irq; |
991 | cdd->irq = irq; | 992 | cdd->irq = irq; |
@@ -994,7 +995,7 @@ static int cppi41_dma_probe(struct platform_device *pdev) | |||
994 | if (ret) | 995 | if (ret) |
995 | goto err_dma_reg; | 996 | goto err_dma_reg; |
996 | 997 | ||
997 | ret = of_dma_controller_register(pdev->dev.of_node, | 998 | ret = of_dma_controller_register(dev->of_node, |
998 | cppi41_dma_xlate, &cpp41_dma_info); | 999 | cppi41_dma_xlate, &cpp41_dma_info); |
999 | if (ret) | 1000 | if (ret) |
1000 | goto err_of; | 1001 | goto err_of; |
@@ -1009,11 +1010,11 @@ err_irq: | |||
1009 | cppi_writel(0, cdd->usbss_mem + USBSS_IRQ_CLEARR); | 1010 | cppi_writel(0, cdd->usbss_mem + USBSS_IRQ_CLEARR); |
1010 | cleanup_chans(cdd); | 1011 | cleanup_chans(cdd); |
1011 | err_chans: | 1012 | err_chans: |
1012 | deinit_cppi41(&pdev->dev, cdd); | 1013 | deinit_cppi41(dev, cdd); |
1013 | err_init_cppi: | 1014 | err_init_cppi: |
1014 | pm_runtime_put(&pdev->dev); | 1015 | pm_runtime_put(dev); |
1015 | err_get_sync: | 1016 | err_get_sync: |
1016 | pm_runtime_disable(&pdev->dev); | 1017 | pm_runtime_disable(dev); |
1017 | iounmap(cdd->usbss_mem); | 1018 | iounmap(cdd->usbss_mem); |
1018 | iounmap(cdd->ctrl_mem); | 1019 | iounmap(cdd->ctrl_mem); |
1019 | iounmap(cdd->sched_mem); | 1020 | iounmap(cdd->sched_mem); |