Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2af1ccd5 authored by Wolfram Sang's avatar Wolfram Sang Committed by David S. Miller
Browse files

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c0bfdae0
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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++) {