diff mbox

mmc: host: use platform_{get,set}_drvdata()

Message ID 000001ce5e87$284f88e0$78ee9aa0$@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jingoo Han June 1, 2013, 5:16 a.m. UTC
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.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/mmc/host/cb710-mmc.c      |    2 +-
 drivers/mmc/host/sh_mobile_sdhi.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Michał Mirosław June 3, 2013, 1:38 a.m. UTC | #1
On Sat, Jun 01, 2013 at 02:16:22PM +0900, Jingoo Han wrote:
> 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.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/mmc/host/cb710-mmc.c      |    2 +-
>  drivers/mmc/host/sh_mobile_sdhi.c |    6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
> index 777ca20..9d6e2b8 100644
> --- a/drivers/mmc/host/cb710-mmc.c
> +++ b/drivers/mmc/host/cb710-mmc.c
> @@ -703,7 +703,7 @@ static int cb710_mmc_init(struct platform_device *pdev)
>  	if (!mmc)
>  		return -ENOMEM;
>  
> -	dev_set_drvdata(&pdev->dev, mmc);
> +	platform_set_drvdata(pdev, mmc);
>  
>  	/* harmless (maybe) magic */
>  	pci_read_config_dword(chip->pdev, 0x48, &val);

You missed the counterpart - cb710_slot_to_mmc() in cb710-mmc.h.
After the fix:

Acked-by: Micha? Miros?aw <mirq-linux@rere.qmqm.pl>
[for cb710]

Best Regards,
Micha? Miros?aw
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jingoo Han June 3, 2013, 4:38 a.m. UTC | #2
On Monday, June 03, 2013 10:39 AM, Micha? Miros?aw wrote:
> On Sat, Jun 01, 2013 at 02:16:22PM +0900, Jingoo Han wrote:
> > 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.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > ---
> >  drivers/mmc/host/cb710-mmc.c      |    2 +-
> >  drivers/mmc/host/sh_mobile_sdhi.c |    6 +++---
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
> > index 777ca20..9d6e2b8 100644
> > --- a/drivers/mmc/host/cb710-mmc.c
> > +++ b/drivers/mmc/host/cb710-mmc.c
> > @@ -703,7 +703,7 @@ static int cb710_mmc_init(struct platform_device *pdev)
> >  	if (!mmc)
> >  		return -ENOMEM;
> >
> > -	dev_set_drvdata(&pdev->dev, mmc);
> > +	platform_set_drvdata(pdev, mmc);
> >
> >  	/* harmless (maybe) magic */
> >  	pci_read_config_dword(chip->pdev, 0x48, &val);
> 
> You missed the counterpart - cb710_slot_to_mmc() in cb710-mmc.h.
> After the fix:

Oh, thank you for your comment. :)
I will fix and send v2 patch soon.
Thank you.

Best regards,
Jingoo Han

> 
> Acked-by: Micha? Miros?aw <mirq-linux@rere.qmqm.pl>
> [for cb710]
> 
> Best Regards,
> Micha? Miros?aw

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

Patch

diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 777ca20..9d6e2b8 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -703,7 +703,7 @@  static int cb710_mmc_init(struct platform_device *pdev)
 	if (!mmc)
 		return -ENOMEM;
 
-	dev_set_drvdata(&pdev->dev, mmc);
+	platform_set_drvdata(pdev, mmc);
 
 	/* harmless (maybe) magic */
 	pci_read_config_dword(chip->pdev, 0x48, &val);
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index cc4c872..6a5d90e 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -51,7 +51,7 @@  struct sh_mobile_sdhi {
 
 static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f)
 {
-	struct mmc_host *mmc = dev_get_drvdata(&pdev->dev);
+	struct mmc_host *mmc = platform_get_drvdata(pdev);
 	struct tmio_mmc_host *host = mmc_priv(mmc);
 	struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
 	int ret = clk_enable(priv->clk);
@@ -64,7 +64,7 @@  static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int
 
 static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev)
 {
-	struct mmc_host *mmc = dev_get_drvdata(&pdev->dev);
+	struct mmc_host *mmc = platform_get_drvdata(pdev);
 	struct tmio_mmc_host *host = mmc_priv(mmc);
 	struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
 	clk_disable(priv->clk);
@@ -119,7 +119,7 @@  static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
 
 static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev)
 {
-	mmc_detect_change(dev_get_drvdata(&pdev->dev), msecs_to_jiffies(100));
+	mmc_detect_change(platform_get_drvdata(pdev), msecs_to_jiffies(100));
 }
 
 static const struct sh_mobile_sdhi_ops sdhi_ops = {