From: Wolfram Sang Date: Sun, 21 Oct 2018 20:00:13 +0000 (+0200) Subject: net: dsa: qca8k: simplify getting .driver_data X-Git-Tag: v5.4-rc1~2403^2~33^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=717de3705dc4cf37d88392e1bdfb0135bd3ac2df;p=platform%2Fkernel%2Flinux-rpi.git net: dsa: qca8k: 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 Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index cdcde7f..7e97e62 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -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);