net: davinci_mdio: use platform_{get,set}_drvdata()
Subsystems (3)
PATCH 8/8 net: davinci_mdio: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.
--- drivers/net/ethernet/ti/davinci_mdio.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/ethernet/ti/davinci_mdio.c +1 -3
@@ -421,8 +421,7 @@ bail_out:static int davinci_mdio_remove (struct platform_device *pdev) { -struct device *dev = &pdev->dev; -struct davinci_mdio_data *data =dev_get_drvdata (dev); +struct davinci_mdio_data *data =platform_get_drvdata (pdev);if (data->bus) {mdiobus_unregister (data->bus);
@@ -434,7 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev)pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev); -dev_set_drvdata (dev,NULL );kfree (data);
Signature · 1 line
1.7.1
Quoted 5 lines · Libo Chen
Use the wrapper functions for getting and setting the driver data using
platform_deviceinstead of using dev_{get,set}_drvdata() with&pdev->dev, so we can directly pass a structplatform_device.Signed-off-by Libo Chen <[email protected]>
Looks good.
Regards
Mugunthan V N
Quoted 13 lines · Libo Chen
Use the wrapper functions for getting and setting the driver data using
platform_deviceinstead of using dev_{get,set}_drvdata() with&pdev->dev, so we can directly pass a structplatform_device.Signed-off-by Libo Chen <[email protected]>--- drivers/net/ethernet/ti/davinci_mdio.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)drivers/net/ethernet/ti/davinci_mdio.c +0
-0
[...]
drivers/net/ethernet/ti/davinci_mdio.c static int davinci_mdio_remove(struct platform_device *pdev) · line 437
Quoted 5 lines
drivers/net/ethernet/ti/davinci_mdio.c +0
-1@@ -434,7 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev)pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev); -dev_set_drvdata (dev,NULL );
Doesn't get described as well. I think you're mixing two types of changes
in one patchset.
WBR, Sergei
David Miller
maintainerFrom: Sergei Shtylyov <[email protected]>
Date: Mon, 12 Aug 2013 22:17:47 +0400
Quoted 2 lines
Doesn't get described as well. I think you're mixing two types of changes in one patchset.
Agreed, you're going to have to redo this entire patch set.
Quoted 8 lines · David Miller
From: Sergei Shtylyov <[email protected]>
Date: Mon, 12 Aug 2013 22:17:47 +0400Quoted 2 lines
Doesn't get described as well. I think you're mixing two types of changes in one patchset.
Agreed, you're going to have to redo this entire patch set.
okay, I will redo!
Quoted 20 lines · Sergei Shtylyov
Quoted 13 lines · Libo Chen
Use the wrapper functions for getting and setting the driver data using
platform_deviceinstead of using dev_{get,set}_drvdata() with&pdev->dev, so we can directly pass a structplatform_device.Signed-off-by Libo Chen <[email protected]>--- drivers/net/ethernet/ti/davinci_mdio.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)drivers/net/ethernet/ti/davinci_mdio.c +0
-0[...]
Quoted 4 lines
drivers/net/ethernet/ti/davinci_mdio.c +0
-0@@ -434,7 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev)pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev);
Quoted 6 lines
drivers/net/ethernet/ti/davinci_mdio.c static int davinci_mdio_remove(struct platform_device *pdev) · line 437
Quoted 1 line
drivers/net/ethernet/ti/davinci_mdio.c +0
-1-dev_set_drvdata (dev,NULL );Doesn't get described as well. I think you're mixing two types of changes in one patchset.
WBR, Sergei
thanks for your attention!
Libo
Quoted 2 lines
PATCH RESEND 8/8 net: davinci_mdio: use platform_{get,set}_drvdata()
In reply to Libo ChenWe can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with &pdev->dev, it is convenient for user.
Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure.
--- drivers/net/ethernet/ti/davinci_mdio.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/ethernet/ti/davinci_mdio.c +1 -3
@@ -421,8 +421,7 @@ bail_out:static int davinci_mdio_remove (struct platform_device *pdev) { -struct device *dev = &pdev->dev; -struct davinci_mdio_data *data =dev_get_drvdata (dev); +struct davinci_mdio_data *data =platform_get_drvdata (pdev);if (data->bus) {mdiobus_unregister (data->bus);
@@ -434,7 +433,6 @@ static int davinci_mdio_remove(struct platform_device *pdev)pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev); -dev_set_drvdata (dev,NULL );kfree (data);
Signature · 1 line
1.7.1