Commit be34c218 authored by Wolfram Sang's avatar Wolfram Sang Committed by Vinod Koul

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 60cc43fc
...@@ -2889,8 +2889,7 @@ static int __init d40_dmaengine_init(struct d40_base *base, ...@@ -2889,8 +2889,7 @@ static int __init d40_dmaengine_init(struct d40_base *base,
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int dma40_suspend(struct device *dev) static int dma40_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct d40_base *base = dev_get_drvdata(dev);
struct d40_base *base = platform_get_drvdata(pdev);
int ret; int ret;
ret = pm_runtime_force_suspend(dev); ret = pm_runtime_force_suspend(dev);
...@@ -2904,8 +2903,7 @@ static int dma40_suspend(struct device *dev) ...@@ -2904,8 +2903,7 @@ static int dma40_suspend(struct device *dev)
static int dma40_resume(struct device *dev) static int dma40_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct d40_base *base = dev_get_drvdata(dev);
struct d40_base *base = platform_get_drvdata(pdev);
int ret = 0; int ret = 0;
if (base->lcpa_regulator) { if (base->lcpa_regulator) {
...@@ -2970,8 +2968,7 @@ static void d40_save_restore_registers(struct d40_base *base, bool save) ...@@ -2970,8 +2968,7 @@ static void d40_save_restore_registers(struct d40_base *base, bool save)
static int dma40_runtime_suspend(struct device *dev) static int dma40_runtime_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct d40_base *base = dev_get_drvdata(dev);
struct d40_base *base = platform_get_drvdata(pdev);
d40_save_restore_registers(base, true); d40_save_restore_registers(base, true);
...@@ -2985,8 +2982,7 @@ static int dma40_runtime_suspend(struct device *dev) ...@@ -2985,8 +2982,7 @@ static int dma40_runtime_suspend(struct device *dev)
static int dma40_runtime_resume(struct device *dev) static int dma40_runtime_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct d40_base *base = dev_get_drvdata(dev);
struct d40_base *base = platform_get_drvdata(pdev);
d40_save_restore_registers(base, false); d40_save_restore_registers(base, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment