Skip to contentSkip to conversation

mtd: devices: use dev_get_platdata()

PATCH Applied Jingoo Han 2 participants 2 messages Jul 30, 2013 – Aug 7, 2013 Memory technology devices (MTD)

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 29/35 mtd: devices: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly.

---
 drivers/mtd/devices/m25p80.c        |    2 +-
 drivers/mtd/devices/mtd_dataflash.c |    2 +-
 drivers/mtd/devices/sst25l.c        |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/devices/m25p80.c +1 -1
index af972b2..026bf9b8 100644
@@ -929,7 +929,7 @@ static int m25p_probe(struct spi_device *spi)
 	 * a chip ID, try the JEDEC id commands; they'll work for most
 	 * newer chips, even if we don't recognize the particular chip.
 	 */
-	data = spi->dev.platform_data;
+	data = dev_get_platdata(&spi->dev);
 	if (data && data->type) {
 		const struct spi_device_id *plat_id;
 
drivers/mtd/devices/mtd_dataflash.c +1 -1
index 4a43664..0e8cbfe 100644
@@ -622,7 +622,7 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages,
 	struct dataflash		*priv;
 	struct mtd_info			*device;
 	struct mtd_part_parser_data	ppdata;
-	struct flash_platform_data	*pdata = spi->dev.platform_data;
+	struct flash_platform_data	*pdata = dev_get_platdata(&spi->dev);
 	char				*otp_tag = "";
 	int				err = 0;
 
drivers/mtd/devices/sst25l.c +1 -1
index 38b5979..a42f1f0 100644
@@ -372,7 +372,7 @@ static int sst25l_probe(struct spi_device *spi)
 	mutex_init(&flash->lock);
 	spi_set_drvdata(spi, flash);
 
-	data = spi->dev.platform_data;
+	data = dev_get_platdata(&spi->dev);
 	if (data && data->name)
 		flash->mtd.name = data->name;
 	else
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 4 lines · Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly.

Applied this and the next three to l2-mtd.git, with a slight amendment for some atmel_nand.c changes. Thanks!

Brian