diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-04-22 05:14:13 -0400 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-04-22 12:07:52 -0400 |
commit | be34c218210298ddd2f00a583ded480115bb270a (patch) | |
tree | 16cf3148033ecd461e82c97291e6e69c8eefa413 | |
parent | 60cc43fc888428bb2f18f08997432d426a243338 (diff) |
dmaengine: ste_dma40: simplify getting .drvdata
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r-- | drivers/dma/ste_dma40.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index c2b089af0420..1bc149af990e 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -2889,8 +2889,7 @@ static int __init d40_dmaengine_init(struct d40_base *base, | |||
2889 | #ifdef CONFIG_PM_SLEEP | 2889 | #ifdef CONFIG_PM_SLEEP |
2890 | static int dma40_suspend(struct device *dev) | 2890 | static int dma40_suspend(struct device *dev) |
2891 | { | 2891 | { |
2892 | struct platform_device *pdev = to_platform_device(dev); | 2892 | struct d40_base *base = dev_get_drvdata(dev); |
2893 | struct d40_base *base = platform_get_drvdata(pdev); | ||
2894 | int ret; | 2893 | int ret; |
2895 | 2894 | ||
2896 | ret = pm_runtime_force_suspend(dev); | 2895 | ret = pm_runtime_force_suspend(dev); |
@@ -2904,8 +2903,7 @@ static int dma40_suspend(struct device *dev) | |||
2904 | 2903 | ||
2905 | static int dma40_resume(struct device *dev) | 2904 | static int dma40_resume(struct device *dev) |
2906 | { | 2905 | { |
2907 | struct platform_device *pdev = to_platform_device(dev); | 2906 | struct d40_base *base = dev_get_drvdata(dev); |
2908 | struct d40_base *base = platform_get_drvdata(pdev); | ||
2909 | int ret = 0; | 2907 | int ret = 0; |
2910 | 2908 | ||
2911 | if (base->lcpa_regulator) { | 2909 | if (base->lcpa_regulator) { |
@@ -2970,8 +2968,7 @@ static void d40_save_restore_registers(struct d40_base *base, bool save) | |||
2970 | 2968 | ||
2971 | static int dma40_runtime_suspend(struct device *dev) | 2969 | static int dma40_runtime_suspend(struct device *dev) |
2972 | { | 2970 | { |
2973 | struct platform_device *pdev = to_platform_device(dev); | 2971 | struct d40_base *base = dev_get_drvdata(dev); |
2974 | struct d40_base *base = platform_get_drvdata(pdev); | ||
2975 | 2972 | ||
2976 | d40_save_restore_registers(base, true); | 2973 | d40_save_restore_registers(base, true); |
2977 | 2974 | ||
@@ -2985,8 +2982,7 @@ static int dma40_runtime_suspend(struct device *dev) | |||
2985 | 2982 | ||
2986 | static int dma40_runtime_resume(struct device *dev) | 2983 | static int dma40_runtime_resume(struct device *dev) |
2987 | { | 2984 | { |
2988 | struct platform_device *pdev = to_platform_device(dev); | 2985 | struct d40_base *base = dev_get_drvdata(dev); |
2989 | struct d40_base *base = platform_get_drvdata(pdev); | ||
2990 | 2986 | ||
2991 | d40_save_restore_registers(base, false); | 2987 | d40_save_restore_registers(base, false); |
2992 | 2988 | ||