Skip to content

Commit

Permalink
net: dsa: legacy: simplify getting .driver_data
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wolfram Sang authored and davem330 committed Oct 23, 2018
1 parent c0bfdae commit 2af1ccd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/dsa/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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++) {
Expand Down

0 comments on commit 2af1ccd

Please sign in to comment.