diff mbox

[RESEND] mmc: mmc_spi: use spi_get_drvdata() and spi_set_drvdata()

Message ID 000101ce9e33$2bfcc6b0$83f65410$%han@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jingoo Han Aug. 21, 2013, 5:56 a.m. UTC
Use the wrapper functions for getting and setting the driver data using
spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we
can directly pass a struct spi_device. This is a cosmetic change
in order to enhance the readability and make the code simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/mmc/host/mmc_spi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

sonic zhang Aug. 21, 2013, 8:30 a.m. UTC | #1
Acked-by: Sonic Zhang <sonic.zhang@analog.com>

>-----Original Message-----
>From: Jingoo Han [mailto:jg1.han@samsung.com]
>Sent: Wednesday, August 21, 2013 1:56 PM
>To: 'Chris Ball'
>Cc: linux-mmc@vger.kernel.org; Zhang, Sonic; 'Jingoo Han'
>Subject: [PATCH RESEND] mmc: mmc_spi: use spi_get_drvdata() and
>spi_set_drvdata()
>
>Use the wrapper functions for getting and setting the driver data using spi_device
>instead of using dev_{get|set}_drvdata with &spi->dev, so we can directly pass a
>struct spi_device. This is a cosmetic change in order to enhance the readability and
>make the code simpler.
>
>Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>---
> drivers/mmc/host/mmc_spi.c |    8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index
>74145d1..5bc7a90 100644
>--- a/drivers/mmc/host/mmc_spi.c
>+++ b/drivers/mmc/host/mmc_spi.c
>@@ -1406,7 +1406,7 @@ static int mmc_spi_probe(struct spi_device *spi)
>                       host->powerup_msecs = 250;
>       }
>
>-      dev_set_drvdata(&spi->dev, mmc);
>+      spi_set_drvdata(spi, mmc);
>
>       /* preallocate dma buffers */
>       host->data = kmalloc(sizeof(*host->data), GFP_KERNEL); @@ -1477,7
>+1477,7 @@ fail_glue_init:
> fail_nobuf1:
>       mmc_free_host(mmc);
>       mmc_spi_put_pdata(spi);
>-      dev_set_drvdata(&spi->dev, NULL);
>+      spi_set_drvdata(spi, NULL);
>
> nomem:
>       kfree(ones);
>@@ -1487,7 +1487,7 @@ nomem:
>
> static int mmc_spi_remove(struct spi_device *spi)  {
>-      struct mmc_host         *mmc = dev_get_drvdata(&spi->dev);
>+      struct mmc_host         *mmc = spi_get_drvdata(spi);
>       struct mmc_spi_host     *host;
>
>       if (mmc) {
>@@ -1512,7 +1512,7 @@ static int mmc_spi_remove(struct spi_device *spi)
>               spi->max_speed_hz = mmc->f_max;
>               mmc_free_host(mmc);
>               mmc_spi_put_pdata(spi);
>-              dev_set_drvdata(&spi->dev, NULL);
>+              spi_set_drvdata(spi, NULL);
>       }
>       return 0;
> }
>--
>1.7.10.4
>
>


--
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/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 74145d1..5bc7a90 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -1406,7 +1406,7 @@  static int mmc_spi_probe(struct spi_device *spi)
 			host->powerup_msecs = 250;
 	}
 
-	dev_set_drvdata(&spi->dev, mmc);
+	spi_set_drvdata(spi, mmc);
 
 	/* preallocate dma buffers */
 	host->data = kmalloc(sizeof(*host->data), GFP_KERNEL);
@@ -1477,7 +1477,7 @@  fail_glue_init:
 fail_nobuf1:
 	mmc_free_host(mmc);
 	mmc_spi_put_pdata(spi);
-	dev_set_drvdata(&spi->dev, NULL);
+	spi_set_drvdata(spi, NULL);
 
 nomem:
 	kfree(ones);
@@ -1487,7 +1487,7 @@  nomem:
 
 static int mmc_spi_remove(struct spi_device *spi)
 {
-	struct mmc_host		*mmc = dev_get_drvdata(&spi->dev);
+	struct mmc_host		*mmc = spi_get_drvdata(spi);
 	struct mmc_spi_host	*host;
 
 	if (mmc) {
@@ -1512,7 +1512,7 @@  static int mmc_spi_remove(struct spi_device *spi)
 		spi->max_speed_hz = mmc->f_max;
 		mmc_free_host(mmc);
 		mmc_spi_put_pdata(spi);
-		dev_set_drvdata(&spi->dev, NULL);
+		spi_set_drvdata(spi, NULL);
 	}
 	return 0;
 }