]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: qca8k: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 21 Oct 2018 20:00:13 +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/qca8k.c

index cdcde7f8e0b275362b759ba95fae337041d553e0..7e97e620bd4476609663f3cb769e13f7f02ce479 100644 (file)
@@ -955,8 +955,7 @@ qca8k_set_pm(struct qca8k_priv *priv, int enable)
 
 static int qca8k_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct qca8k_priv *priv = platform_get_drvdata(pdev);
+       struct qca8k_priv *priv = dev_get_drvdata(dev);
 
        qca8k_set_pm(priv, 0);
 
@@ -965,8 +964,7 @@ static int qca8k_suspend(struct device *dev)
 
 static int qca8k_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct qca8k_priv *priv = platform_get_drvdata(pdev);
+       struct qca8k_priv *priv = dev_get_drvdata(dev);
 
        qca8k_set_pm(priv, 1);