Patchwork [1/5] net: emac: use platform_{get,set}_drvdata()

login
register
mail settings
Submitter Jingoo Han
Date Sept. 2, 2013, 8:06 a.m.
Message ID <000f01cea7b3$6226fd30$2674f790$%han@samsung.com>
Download mbox | patch
Permalink /patch/271707/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jingoo Han - Sept. 2, 2013, 8:06 a.m.
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.
This is a purely cosmetic change.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/net/ethernet/ibm/emac/core.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
David Miller - Sept. 4, 2013, 2:40 a.m.
From: Jingoo Han <jg1.han@samsung.com>
Date: Mon, 02 Sep 2013 17:06:52 +0900

> 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.
> This is a purely cosmetic change.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

All 5 patches applied.

Please, in the future, provide an initial "[PATCH 00/nn] " posting for
a series of patches, giving a top-level description of what is happening.

This way I can include that commit message text in a merge commit and
also I have an appropriate email to reply to if I just want to say
that I applied everything in the series.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jingoo Han - Sept. 4, 2013, 3 a.m.
On Wednesday, September 04, 2013 11:40 AM, David Miller wrote:
> 
> From: Jingoo Han <jg1.han@samsung.com>
> Date: Mon, 02 Sep 2013 17:06:52 +0900
> 
> > 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.
> > This is a purely cosmetic change.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> 
> All 5 patches applied.
> 
> Please, in the future, provide an initial "[PATCH 00/nn] " posting for
> a series of patches, giving a top-level description of what is happening.

OK, I will provide an initial "[PATCH 00/nn]" posting.
Thank you for your suggestion. :-)

Best regards,
Jingoo Han

> 
> This way I can include that commit message text in a merge commit and
> also I have an appropriate email to reply to if I just want to say
> that I applied everything in the series.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index 2d3b064..6b5c722 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -2312,7 +2312,7 @@  static int emac_check_deps(struct emac_instance *dev,
 		if (deps[i].ofdev == NULL)
 			continue;
 		if (deps[i].drvdata == NULL)
-			deps[i].drvdata = dev_get_drvdata(&deps[i].ofdev->dev);
+			deps[i].drvdata = platform_get_drvdata(deps[i].ofdev);
 		if (deps[i].drvdata != NULL)
 			there++;
 	}
@@ -2799,9 +2799,9 @@  static int emac_probe(struct platform_device *ofdev)
 		/*  display more info about what's missing ? */
 		goto err_reg_unmap;
 	}
-	dev->mal = dev_get_drvdata(&dev->mal_dev->dev);
+	dev->mal = platform_get_drvdata(dev->mal_dev);
 	if (dev->mdio_dev != NULL)
-		dev->mdio_instance = dev_get_drvdata(&dev->mdio_dev->dev);
+		dev->mdio_instance = platform_get_drvdata(dev->mdio_dev);
 
 	/* Register with MAL */
 	dev->commac.ops = &emac_commac_ops;
@@ -2892,7 +2892,7 @@  static int emac_probe(struct platform_device *ofdev)
 	 * fully initialized
 	 */
 	wmb();
-	dev_set_drvdata(&ofdev->dev, dev);
+	platform_set_drvdata(ofdev, dev);
 
 	/* There's a new kid in town ! Let's tell everybody */
 	wake_up_all(&emac_probe_wait);
@@ -2951,7 +2951,7 @@  static int emac_probe(struct platform_device *ofdev)
 
 static int emac_remove(struct platform_device *ofdev)
 {
-	struct emac_instance *dev = dev_get_drvdata(&ofdev->dev);
+	struct emac_instance *dev = platform_get_drvdata(ofdev);
 
 	DBG(dev, "remove" NL);