]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: dsa: bcm_sf2: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 21 Oct 2018 20:00:12 +0000 (22:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Oct 2018 04:10:11 +0000 (21:10 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2.c

index 3017ecf82ca5439258b81ba1aacad76631737ee3..2eb68769562cd9bab6c95f75afc08b5666982992 100644 (file)
@@ -1190,16 +1190,14 @@ static void bcm_sf2_sw_shutdown(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int bcm_sf2_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct bcm_sf2_priv *priv = platform_get_drvdata(pdev);
+       struct bcm_sf2_priv *priv = dev_get_drvdata(dev);
 
        return dsa_switch_suspend(priv->dev->ds);
 }
 
 static int bcm_sf2_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct bcm_sf2_priv *priv = platform_get_drvdata(pdev);
+       struct bcm_sf2_priv *priv = dev_get_drvdata(dev);
 
        return dsa_switch_resume(priv->dev->ds);
 }