Skip to content

Commit 2af1ccd

Browse files
Wolfram Sangdavem330
authored andcommitted
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c0bfdae commit 2af1ccd

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎net/dsa/legacy.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,7 @@ static void dsa_shutdown(struct platform_device *pdev)
686686
#ifdef CONFIG_PM_SLEEP
687687
static int dsa_suspend(struct device *d)
688688
{
689-
struct platform_device *pdev = to_platform_device(d);
690-
struct dsa_switch_tree *dst = platform_get_drvdata(pdev);
689+
struct dsa_switch_tree *dst = dev_get_drvdata(d);
691690
int i, ret = 0;
692691

693692
for (i = 0; i < dst->pd->nr_chips; i++) {
@@ -702,8 +701,7 @@ static int dsa_suspend(struct device *d)
702701

703702
static int dsa_resume(struct device *d)
704703
{
705-
struct platform_device *pdev = to_platform_device(d);
706-
struct dsa_switch_tree *dst = platform_get_drvdata(pdev);
704+
struct dsa_switch_tree *dst = dev_get_drvdata(d);
707705
int i, ret = 0;
708706

709707
for (i = 0; i < dst->pd->nr_chips; i++) {

0 commit comments

Comments
 (0)