Patchwork [3/3] mtd: m25p80: use spi_get_drvdata() and spi_set_drvdata()

login
register
mail settings
Submitter Jingoo Han
Date April 6, 2013, 6:41 a.m.
Message ID <001601ce3291$c6d7a0f0$5486e2d0$%han@samsung.com>
Download mbox | patch
Permalink /patch/234315/
State Accepted
Commit 975aefc9de7ab893e9e784ec52cf97e1827259da
Headers show

Comments

Jingoo Han - April 6, 2013, 6:41 a.m.
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.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/mtd/devices/m25p80.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 2f3d2a5..d2232e7 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -972,7 +972,7 @@  static int m25p_probe(struct spi_device *spi)
 
 	flash->spi = spi;
 	mutex_init(&flash->lock);
-	dev_set_drvdata(&spi->dev, flash);
+	spi_set_drvdata(spi, flash);
 
 	/*
 	 * Atmel, SST and Intel/Numonyx serial flash tend to power
@@ -1080,7 +1080,7 @@  static int m25p_probe(struct spi_device *spi)
 
 static int m25p_remove(struct spi_device *spi)
 {
-	struct m25p	*flash = dev_get_drvdata(&spi->dev);
+	struct m25p	*flash = spi_get_drvdata(spi);
 	int		status;
 
 	/* Clean up MTD stuff. */