* [PATCH 1/3] mtd: sst25l: use spi_get_drvdata() and spi_set_drvdata()
@ 2013-04-06 6:40 Jingoo Han
2013-04-06 6:41 ` [PATCH 2/3] mtd: dataflash: " Jingoo Han
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jingoo Han @ 2013-04-06 6:40 UTC (permalink / raw)
To: 'Artem Bityutskiy'
Cc: linux-mtd, 'Jingoo Han', 'David Woodhouse'
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/sst25l.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index 8091b01..38b5979 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -370,7 +370,7 @@ static int sst25l_probe(struct spi_device *spi)
flash->spi = spi;
mutex_init(&flash->lock);
- dev_set_drvdata(&spi->dev, flash);
+ spi_set_drvdata(spi, flash);
data = spi->dev.platform_data;
if (data && data->name)
@@ -404,7 +404,7 @@ static int sst25l_probe(struct spi_device *spi)
data ? data->nr_parts : 0);
if (ret) {
kfree(flash);
- dev_set_drvdata(&spi->dev, NULL);
+ spi_set_drvdata(spi, NULL);
return -ENODEV;
}
@@ -413,7 +413,7 @@ static int sst25l_probe(struct spi_device *spi)
static int sst25l_remove(struct spi_device *spi)
{
- struct sst25l_flash *flash = dev_get_drvdata(&spi->dev);
+ struct sst25l_flash *flash = spi_get_drvdata(spi);
int ret;
ret = mtd_device_unregister(&flash->mtd);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] mtd: dataflash: use spi_get_drvdata() and spi_set_drvdata()
2013-04-06 6:40 [PATCH 1/3] mtd: sst25l: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
@ 2013-04-06 6:41 ` Jingoo Han
2013-04-06 6:41 ` [PATCH 3/3] mtd: m25p80: " Jingoo Han
2013-05-10 14:44 ` [PATCH 1/3] mtd: sst25l: " Artem Bityutskiy
2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2013-04-06 6:41 UTC (permalink / raw)
To: 'Artem Bityutskiy'
Cc: linux-mtd, 'Jingoo Han', 'David Woodhouse'
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/mtd_dataflash.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 28779b6..4a43664 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -661,7 +661,7 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages,
dev_info(&spi->dev, "%s (%lld KBytes) pagesize %d bytes%s\n",
name, (long long)((device->size + 1023) >> 10),
pagesize, otp_tag);
- dev_set_drvdata(&spi->dev, priv);
+ spi_set_drvdata(spi, priv);
ppdata.of_node = spi->dev.of_node;
err = mtd_device_parse_register(device, NULL, &ppdata,
@@ -671,7 +671,7 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages,
if (!err)
return 0;
- dev_set_drvdata(&spi->dev, NULL);
+ spi_set_drvdata(spi, NULL);
kfree(priv);
return err;
}
@@ -895,14 +895,14 @@ static int dataflash_probe(struct spi_device *spi)
static int dataflash_remove(struct spi_device *spi)
{
- struct dataflash *flash = dev_get_drvdata(&spi->dev);
+ struct dataflash *flash = spi_get_drvdata(spi);
int status;
pr_debug("%s: remove\n", dev_name(&spi->dev));
status = mtd_device_unregister(&flash->mtd);
if (status == 0) {
- dev_set_drvdata(&spi->dev, NULL);
+ spi_set_drvdata(spi, NULL);
kfree(flash);
}
return status;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] mtd: m25p80: use spi_get_drvdata() and spi_set_drvdata()
2013-04-06 6:40 [PATCH 1/3] mtd: sst25l: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2013-04-06 6:41 ` [PATCH 2/3] mtd: dataflash: " Jingoo Han
@ 2013-04-06 6:41 ` Jingoo Han
2013-05-10 14:44 ` [PATCH 1/3] mtd: sst25l: " Artem Bityutskiy
2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2013-04-06 6:41 UTC (permalink / raw)
To: 'Artem Bityutskiy'
Cc: linux-mtd, 'Jingoo Han', 'David Woodhouse'
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(-)
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. */
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] mtd: sst25l: use spi_get_drvdata() and spi_set_drvdata()
2013-04-06 6:40 [PATCH 1/3] mtd: sst25l: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2013-04-06 6:41 ` [PATCH 2/3] mtd: dataflash: " Jingoo Han
2013-04-06 6:41 ` [PATCH 3/3] mtd: m25p80: " Jingoo Han
@ 2013-05-10 14:44 ` Artem Bityutskiy
2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2013-05-10 14:44 UTC (permalink / raw)
To: Jingoo Han; +Cc: linux-mtd, 'David Woodhouse'
On Sat, 2013-04-06 at 15:40 +0900, Jingoo Han wrote:
> 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>
Pushed to l2-mtd.git, thanks!
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-10 14:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-06 6:40 [PATCH 1/3] mtd: sst25l: use spi_get_drvdata() and spi_set_drvdata() Jingoo Han
2013-04-06 6:41 ` [PATCH 2/3] mtd: dataflash: " Jingoo Han
2013-04-06 6:41 ` [PATCH 3/3] mtd: m25p80: " Jingoo Han
2013-05-10 14:44 ` [PATCH 1/3] mtd: sst25l: " Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).