diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-10-21 22:01:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-22 19:49:04 -0700 |
commit | 2af1ccd58107d65f87b747c90a965b2ba97b4feb (patch) | |
tree | 30e5407166282b1c4036c407f011f9890caab917 /net/dsa/legacy.c | |
parent | c0bfdae013e809b209ac325a9895b9ba22599c93 (diff) |
net: dsa: legacy: simplify getting .driver_data
We should get 'driver_data' 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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/legacy.c')
-rw-r--r-- | net/dsa/legacy.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c index 8aa92b09db76..cb42939db776 100644 --- a/net/dsa/legacy.c +++ b/net/dsa/legacy.c @@ -686,8 +686,7 @@ static void dsa_shutdown(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int dsa_suspend(struct device *d) { - struct platform_device *pdev = to_platform_device(d); - struct dsa_switch_tree *dst = platform_get_drvdata(pdev); + struct dsa_switch_tree *dst = dev_get_drvdata(d); int i, ret = 0; for (i = 0; i < dst->pd->nr_chips; i++) { @@ -702,8 +701,7 @@ static int dsa_suspend(struct device *d) static int dsa_resume(struct device *d) { - struct platform_device *pdev = to_platform_device(d); - struct dsa_switch_tree *dst = platform_get_drvdata(pdev); + struct dsa_switch_tree *dst = dev_get_drvdata(d); int i, ret = 0; for (i = 0; i < dst->pd->nr_chips; i++) { |