diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-07-30 04:18:33 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-30 16:34:33 -0400 |
commit | 453810b79571ff6622a481f0556fc4972f87a24f (patch) | |
tree | dd85005761927d3aa209c9fc642e945ec60ecdd2 | |
parent | d20d5a5780a014bc4d24dbcb6daf7673a9dddf98 (diff) |
mtd: nand: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/mtd/nand/atmel_nand.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/au1550nd.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/bf5xx_nand.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/davinci_nand.c | 6 | ||||
-rw-r--r-- | drivers/mtd/nand/gpio.c | 6 | ||||
-rw-r--r-- | drivers/mtd/nand/jz4740_nand.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/lpc32xx_mlc.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/lpc32xx_slc.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 3 | ||||
-rw-r--r-- | drivers/mtd/nand/omap2.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/orion_nand.c | 5 | ||||
-rw-r--r-- | drivers/mtd/nand/plat_nand.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/pxa3xx_nand.c | 14 | ||||
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/sh_flctl.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/sharpsl.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/tmio_nand.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/txx9ndfmc.c | 8 |
18 files changed, 37 insertions, 35 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index ddcd575b2823..1ffa52f7ab4a 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c | |||
@@ -2023,7 +2023,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
2023 | if (res) | 2023 | if (res) |
2024 | goto err_nand_ioremap; | 2024 | goto err_nand_ioremap; |
2025 | } else { | 2025 | } else { |
2026 | memcpy(&host->board, pdev->dev.platform_data, | 2026 | memcpy(&host->board, dev_get_platdata(&pdev->dev), |
2027 | sizeof(struct atmel_nand_data)); | 2027 | sizeof(struct atmel_nand_data)); |
2028 | } | 2028 | } |
2029 | 2029 | ||
diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c index 217459d02b2f..ae8dd7c41039 100644 --- a/drivers/mtd/nand/au1550nd.c +++ b/drivers/mtd/nand/au1550nd.c | |||
@@ -411,7 +411,7 @@ static int au1550nd_probe(struct platform_device *pdev) | |||
411 | struct resource *r; | 411 | struct resource *r; |
412 | int ret, cs; | 412 | int ret, cs; |
413 | 413 | ||
414 | pd = pdev->dev.platform_data; | 414 | pd = dev_get_platdata(&pdev->dev); |
415 | if (!pd) { | 415 | if (!pd) { |
416 | dev_err(&pdev->dev, "missing platform data\n"); | 416 | dev_err(&pdev->dev, "missing platform data\n"); |
417 | return -ENODEV; | 417 | return -ENODEV; |
diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c index 809a63c53fc5..2c42e125720f 100644 --- a/drivers/mtd/nand/bf5xx_nand.c +++ b/drivers/mtd/nand/bf5xx_nand.c | |||
@@ -171,7 +171,7 @@ static struct bf5xx_nand_info *to_nand_info(struct platform_device *pdev) | |||
171 | 171 | ||
172 | static struct bf5xx_nand_platform *to_nand_plat(struct platform_device *pdev) | 172 | static struct bf5xx_nand_platform *to_nand_plat(struct platform_device *pdev) |
173 | { | 173 | { |
174 | return pdev->dev.platform_data; | 174 | return dev_get_platdata(&pdev->dev); |
175 | } | 175 | } |
176 | 176 | ||
177 | /* | 177 | /* |
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 999ad9cb2901..b77a01efb483 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c | |||
@@ -530,7 +530,7 @@ MODULE_DEVICE_TABLE(of, davinci_nand_of_match); | |||
530 | static struct davinci_nand_pdata | 530 | static struct davinci_nand_pdata |
531 | *nand_davinci_get_pdata(struct platform_device *pdev) | 531 | *nand_davinci_get_pdata(struct platform_device *pdev) |
532 | { | 532 | { |
533 | if (!pdev->dev.platform_data && pdev->dev.of_node) { | 533 | if (!dev_get_platdata(&pdev->dev) && pdev->dev.of_node) { |
534 | struct davinci_nand_pdata *pdata; | 534 | struct davinci_nand_pdata *pdata; |
535 | const char *mode; | 535 | const char *mode; |
536 | u32 prop; | 536 | u32 prop; |
@@ -575,13 +575,13 @@ static struct davinci_nand_pdata | |||
575 | pdata->bbt_options = NAND_BBT_USE_FLASH; | 575 | pdata->bbt_options = NAND_BBT_USE_FLASH; |
576 | } | 576 | } |
577 | 577 | ||
578 | return pdev->dev.platform_data; | 578 | return dev_get_platdata(&pdev->dev); |
579 | } | 579 | } |
580 | #else | 580 | #else |
581 | static struct davinci_nand_pdata | 581 | static struct davinci_nand_pdata |
582 | *nand_davinci_get_pdata(struct platform_device *pdev) | 582 | *nand_davinci_get_pdata(struct platform_device *pdev) |
583 | { | 583 | { |
584 | return pdev->dev.platform_data; | 584 | return dev_get_platdata(&pdev->dev); |
585 | } | 585 | } |
586 | #endif | 586 | #endif |
587 | 587 | ||
diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c index 800a1cc5015d..e826f898241f 100644 --- a/drivers/mtd/nand/gpio.c +++ b/drivers/mtd/nand/gpio.c | |||
@@ -167,8 +167,8 @@ static inline int gpio_nand_get_config(const struct device *dev, | |||
167 | if (!ret) | 167 | if (!ret) |
168 | return ret; | 168 | return ret; |
169 | 169 | ||
170 | if (dev->platform_data) { | 170 | if (dev_get_platdata(dev)) { |
171 | memcpy(plat, dev->platform_data, sizeof(*plat)); | 171 | memcpy(plat, dev_get_platdata(dev), sizeof(*plat)); |
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
@@ -207,7 +207,7 @@ static int gpio_nand_probe(struct platform_device *pdev) | |||
207 | struct mtd_part_parser_data ppdata = {}; | 207 | struct mtd_part_parser_data ppdata = {}; |
208 | int ret = 0; | 208 | int ret = 0; |
209 | 209 | ||
210 | if (!pdev->dev.of_node && !pdev->dev.platform_data) | 210 | if (!pdev->dev.of_node && !dev_get_platdata(&pdev->dev)) |
211 | return -EINVAL; | 211 | return -EINVAL; |
212 | 212 | ||
213 | gpiomtd = devm_kzalloc(&pdev->dev, sizeof(*gpiomtd), GFP_KERNEL); | 213 | gpiomtd = devm_kzalloc(&pdev->dev, sizeof(*gpiomtd), GFP_KERNEL); |
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c index 698a4d1c1f93..a264b888c66c 100644 --- a/drivers/mtd/nand/jz4740_nand.c +++ b/drivers/mtd/nand/jz4740_nand.c | |||
@@ -411,7 +411,7 @@ static int jz_nand_probe(struct platform_device *pdev) | |||
411 | struct jz_nand *nand; | 411 | struct jz_nand *nand; |
412 | struct nand_chip *chip; | 412 | struct nand_chip *chip; |
413 | struct mtd_info *mtd; | 413 | struct mtd_info *mtd; |
414 | struct jz_nand_platform_data *pdata = pdev->dev.platform_data; | 414 | struct jz_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); |
415 | size_t chipnr, bank_idx; | 415 | size_t chipnr, bank_idx; |
416 | uint8_t nand_maf_id = 0, nand_dev_id = 0; | 416 | uint8_t nand_maf_id = 0, nand_dev_id = 0; |
417 | 417 | ||
@@ -548,7 +548,7 @@ err_free: | |||
548 | static int jz_nand_remove(struct platform_device *pdev) | 548 | static int jz_nand_remove(struct platform_device *pdev) |
549 | { | 549 | { |
550 | struct jz_nand *nand = platform_get_drvdata(pdev); | 550 | struct jz_nand *nand = platform_get_drvdata(pdev); |
551 | struct jz_nand_platform_data *pdata = pdev->dev.platform_data; | 551 | struct jz_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); |
552 | size_t i; | 552 | size_t i; |
553 | 553 | ||
554 | nand_release(&nand->mtd); | 554 | nand_release(&nand->mtd); |
diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c index 74a469b83c0d..f4dd2a887ea5 100644 --- a/drivers/mtd/nand/lpc32xx_mlc.c +++ b/drivers/mtd/nand/lpc32xx_mlc.c | |||
@@ -696,7 +696,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) | |||
696 | } | 696 | } |
697 | lpc32xx_wp_disable(host); | 697 | lpc32xx_wp_disable(host); |
698 | 698 | ||
699 | host->pdata = pdev->dev.platform_data; | 699 | host->pdata = dev_get_platdata(&pdev->dev); |
700 | 700 | ||
701 | nand_chip->priv = host; /* link the private data structures */ | 701 | nand_chip->priv = host; /* link the private data structures */ |
702 | mtd->priv = nand_chip; | 702 | mtd->priv = nand_chip; |
diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c index a66f33f25974..add75709d415 100644 --- a/drivers/mtd/nand/lpc32xx_slc.c +++ b/drivers/mtd/nand/lpc32xx_slc.c | |||
@@ -798,7 +798,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) | |||
798 | } | 798 | } |
799 | lpc32xx_wp_disable(host); | 799 | lpc32xx_wp_disable(host); |
800 | 800 | ||
801 | host->pdata = pdev->dev.platform_data; | 801 | host->pdata = dev_get_platdata(&pdev->dev); |
802 | 802 | ||
803 | mtd = &host->mtd; | 803 | mtd = &host->mtd; |
804 | chip = &host->nand_chip; | 804 | chip = &host->nand_chip; |
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 0581bd37c498..a99ff1d6d1ca 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -1432,7 +1432,8 @@ static int mxcnd_probe(struct platform_device *pdev) | |||
1432 | 1432 | ||
1433 | err = mxcnd_probe_dt(host); | 1433 | err = mxcnd_probe_dt(host); |
1434 | if (err > 0) { | 1434 | if (err > 0) { |
1435 | struct mxc_nand_platform_data *pdata = pdev->dev.platform_data; | 1435 | struct mxc_nand_platform_data *pdata = |
1436 | dev_get_platdata(&pdev->dev); | ||
1436 | if (pdata) { | 1437 | if (pdata) { |
1437 | host->pdata = *pdata; | 1438 | host->pdata = *pdata; |
1438 | host->devtype_data = (struct mxc_nand_devtype_data *) | 1439 | host->devtype_data = (struct mxc_nand_devtype_data *) |
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index cb40f87ee93c..4ecf0e5fd484 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -1831,7 +1831,7 @@ static int omap_nand_probe(struct platform_device *pdev) | |||
1831 | struct resource *res; | 1831 | struct resource *res; |
1832 | struct mtd_part_parser_data ppdata = {}; | 1832 | struct mtd_part_parser_data ppdata = {}; |
1833 | 1833 | ||
1834 | pdata = pdev->dev.platform_data; | 1834 | pdata = dev_get_platdata(&pdev->dev); |
1835 | if (pdata == NULL) { | 1835 | if (pdata == NULL) { |
1836 | dev_err(&pdev->dev, "platform data missing\n"); | 1836 | dev_err(&pdev->dev, "platform data missing\n"); |
1837 | return -ENODEV; | 1837 | return -ENODEV; |
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 46f308df8438..a393a5b6ce1e 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c | |||
@@ -130,8 +130,9 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
130 | if (!of_property_read_u32(pdev->dev.of_node, | 130 | if (!of_property_read_u32(pdev->dev.of_node, |
131 | "chip-delay", &val)) | 131 | "chip-delay", &val)) |
132 | board->chip_delay = (u8)val; | 132 | board->chip_delay = (u8)val; |
133 | } else | 133 | } else { |
134 | board = pdev->dev.platform_data; | 134 | board = dev_get_platdata(&pdev->dev); |
135 | } | ||
135 | 136 | ||
136 | mtd->priv = nc; | 137 | mtd->priv = nc; |
137 | mtd->owner = THIS_MODULE; | 138 | mtd->owner = THIS_MODULE; |
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index d42700a774e9..cad4cdc9df39 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c | |||
@@ -30,7 +30,7 @@ static const char *part_probe_types[] = { "cmdlinepart", NULL }; | |||
30 | */ | 30 | */ |
31 | static int plat_nand_probe(struct platform_device *pdev) | 31 | static int plat_nand_probe(struct platform_device *pdev) |
32 | { | 32 | { |
33 | struct platform_nand_data *pdata = pdev->dev.platform_data; | 33 | struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev); |
34 | struct mtd_part_parser_data ppdata; | 34 | struct mtd_part_parser_data ppdata; |
35 | struct plat_nand_data *data; | 35 | struct plat_nand_data *data; |
36 | struct resource *res; | 36 | struct resource *res; |
@@ -136,7 +136,7 @@ out_free: | |||
136 | static int plat_nand_remove(struct platform_device *pdev) | 136 | static int plat_nand_remove(struct platform_device *pdev) |
137 | { | 137 | { |
138 | struct plat_nand_data *data = platform_get_drvdata(pdev); | 138 | struct plat_nand_data *data = platform_get_drvdata(pdev); |
139 | struct platform_nand_data *pdata = pdev->dev.platform_data; | 139 | struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev); |
140 | struct resource *res; | 140 | struct resource *res; |
141 | 141 | ||
142 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 142 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index fdc045d9d2ac..501e380211e0 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -815,7 +815,7 @@ static int pxa3xx_nand_config_flash(struct pxa3xx_nand_info *info, | |||
815 | const struct pxa3xx_nand_flash *f) | 815 | const struct pxa3xx_nand_flash *f) |
816 | { | 816 | { |
817 | struct platform_device *pdev = info->pdev; | 817 | struct platform_device *pdev = info->pdev; |
818 | struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data; | 818 | struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); |
819 | struct pxa3xx_nand_host *host = info->host[info->cs]; | 819 | struct pxa3xx_nand_host *host = info->host[info->cs]; |
820 | uint32_t ndcr = 0x0; /* enable all interrupts */ | 820 | uint32_t ndcr = 0x0; /* enable all interrupts */ |
821 | 821 | ||
@@ -958,7 +958,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd) | |||
958 | struct pxa3xx_nand_host *host = mtd->priv; | 958 | struct pxa3xx_nand_host *host = mtd->priv; |
959 | struct pxa3xx_nand_info *info = host->info_data; | 959 | struct pxa3xx_nand_info *info = host->info_data; |
960 | struct platform_device *pdev = info->pdev; | 960 | struct platform_device *pdev = info->pdev; |
961 | struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data; | 961 | struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); |
962 | struct nand_flash_dev pxa3xx_flash_ids[2], *def = NULL; | 962 | struct nand_flash_dev pxa3xx_flash_ids[2], *def = NULL; |
963 | const struct pxa3xx_nand_flash *f = NULL; | 963 | const struct pxa3xx_nand_flash *f = NULL; |
964 | struct nand_chip *chip = mtd->priv; | 964 | struct nand_chip *chip = mtd->priv; |
@@ -1058,7 +1058,7 @@ static int alloc_nand_resource(struct platform_device *pdev) | |||
1058 | struct resource *r; | 1058 | struct resource *r; |
1059 | int ret, irq, cs; | 1059 | int ret, irq, cs; |
1060 | 1060 | ||
1061 | pdata = pdev->dev.platform_data; | 1061 | pdata = dev_get_platdata(&pdev->dev); |
1062 | info = devm_kzalloc(&pdev->dev, sizeof(*info) + (sizeof(*mtd) + | 1062 | info = devm_kzalloc(&pdev->dev, sizeof(*info) + (sizeof(*mtd) + |
1063 | sizeof(*host)) * pdata->num_cs, GFP_KERNEL); | 1063 | sizeof(*host)) * pdata->num_cs, GFP_KERNEL); |
1064 | if (!info) | 1064 | if (!info) |
@@ -1176,7 +1176,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) | |||
1176 | if (!info) | 1176 | if (!info) |
1177 | return 0; | 1177 | return 0; |
1178 | 1178 | ||
1179 | pdata = pdev->dev.platform_data; | 1179 | pdata = dev_get_platdata(&pdev->dev); |
1180 | 1180 | ||
1181 | irq = platform_get_irq(pdev, 0); | 1181 | irq = platform_get_irq(pdev, 0); |
1182 | if (irq >= 0) | 1182 | if (irq >= 0) |
@@ -1239,7 +1239,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1239 | if (ret) | 1239 | if (ret) |
1240 | return ret; | 1240 | return ret; |
1241 | 1241 | ||
1242 | pdata = pdev->dev.platform_data; | 1242 | pdata = dev_get_platdata(&pdev->dev); |
1243 | if (!pdata) { | 1243 | if (!pdata) { |
1244 | dev_err(&pdev->dev, "no platform data defined\n"); | 1244 | dev_err(&pdev->dev, "no platform data defined\n"); |
1245 | return -ENODEV; | 1245 | return -ENODEV; |
@@ -1286,7 +1286,7 @@ static int pxa3xx_nand_suspend(struct platform_device *pdev, pm_message_t state) | |||
1286 | struct mtd_info *mtd; | 1286 | struct mtd_info *mtd; |
1287 | int cs; | 1287 | int cs; |
1288 | 1288 | ||
1289 | pdata = pdev->dev.platform_data; | 1289 | pdata = dev_get_platdata(&pdev->dev); |
1290 | if (info->state) { | 1290 | if (info->state) { |
1291 | dev_err(&pdev->dev, "driver busy, state = %d\n", info->state); | 1291 | dev_err(&pdev->dev, "driver busy, state = %d\n", info->state); |
1292 | return -EAGAIN; | 1292 | return -EAGAIN; |
@@ -1307,7 +1307,7 @@ static int pxa3xx_nand_resume(struct platform_device *pdev) | |||
1307 | struct mtd_info *mtd; | 1307 | struct mtd_info *mtd; |
1308 | int cs; | 1308 | int cs; |
1309 | 1309 | ||
1310 | pdata = pdev->dev.platform_data; | 1310 | pdata = dev_get_platdata(&pdev->dev); |
1311 | /* We don't want to handle interrupt without calling mtd routine */ | 1311 | /* We don't want to handle interrupt without calling mtd routine */ |
1312 | disable_int(info, NDCR_INT_MASK); | 1312 | disable_int(info, NDCR_INT_MASK); |
1313 | 1313 | ||
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 191823ed706e..d65cbe903d40 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -150,7 +150,7 @@ static struct s3c2410_nand_info *to_nand_info(struct platform_device *dev) | |||
150 | 150 | ||
151 | static struct s3c2410_platform_nand *to_nand_plat(struct platform_device *dev) | 151 | static struct s3c2410_platform_nand *to_nand_plat(struct platform_device *dev) |
152 | { | 152 | { |
153 | return dev->dev.platform_data; | 153 | return dev_get_platdata(&dev->dev); |
154 | } | 154 | } |
155 | 155 | ||
156 | static inline int allow_clk_suspend(struct s3c2410_nand_info *info) | 156 | static inline int allow_clk_suspend(struct s3c2410_nand_info *info) |
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c index e57e18e8c289..a3c84ebbe392 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c | |||
@@ -137,7 +137,7 @@ static void flctl_setup_dma(struct sh_flctl *flctl) | |||
137 | dma_cap_mask_t mask; | 137 | dma_cap_mask_t mask; |
138 | struct dma_slave_config cfg; | 138 | struct dma_slave_config cfg; |
139 | struct platform_device *pdev = flctl->pdev; | 139 | struct platform_device *pdev = flctl->pdev; |
140 | struct sh_flctl_platform_data *pdata = pdev->dev.platform_data; | 140 | struct sh_flctl_platform_data *pdata = dev_get_platdata(&pdev->dev); |
141 | int ret; | 141 | int ret; |
142 | 142 | ||
143 | if (!pdata) | 143 | if (!pdata) |
@@ -1131,7 +1131,7 @@ static int flctl_probe(struct platform_device *pdev) | |||
1131 | if (pdev->dev.of_node) | 1131 | if (pdev->dev.of_node) |
1132 | pdata = flctl_parse_dt(&pdev->dev); | 1132 | pdata = flctl_parse_dt(&pdev->dev); |
1133 | else | 1133 | else |
1134 | pdata = pdev->dev.platform_data; | 1134 | pdata = dev_get_platdata(&pdev->dev); |
1135 | 1135 | ||
1136 | if (!pdata) { | 1136 | if (!pdata) { |
1137 | dev_err(&pdev->dev, "no setup data defined\n"); | 1137 | dev_err(&pdev->dev, "no setup data defined\n"); |
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index 1d41578d0336..87908d760feb 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -112,7 +112,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev) | |||
112 | struct resource *r; | 112 | struct resource *r; |
113 | int err = 0; | 113 | int err = 0; |
114 | struct sharpsl_nand *sharpsl; | 114 | struct sharpsl_nand *sharpsl; |
115 | struct sharpsl_nand_platform_data *data = pdev->dev.platform_data; | 115 | struct sharpsl_nand_platform_data *data = dev_get_platdata(&pdev->dev); |
116 | 116 | ||
117 | if (!data) { | 117 | if (!data) { |
118 | dev_err(&pdev->dev, "no platform data!\n"); | 118 | dev_err(&pdev->dev, "no platform data!\n"); |
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c index 508e9e04b092..396530d87ecf 100644 --- a/drivers/mtd/nand/tmio_nand.c +++ b/drivers/mtd/nand/tmio_nand.c | |||
@@ -357,7 +357,7 @@ static void tmio_hw_stop(struct platform_device *dev, struct tmio_nand *tmio) | |||
357 | 357 | ||
358 | static int tmio_probe(struct platform_device *dev) | 358 | static int tmio_probe(struct platform_device *dev) |
359 | { | 359 | { |
360 | struct tmio_nand_data *data = dev->dev.platform_data; | 360 | struct tmio_nand_data *data = dev_get_platdata(&dev->dev); |
361 | struct resource *fcr = platform_get_resource(dev, | 361 | struct resource *fcr = platform_get_resource(dev, |
362 | IORESOURCE_MEM, 0); | 362 | IORESOURCE_MEM, 0); |
363 | struct resource *ccr = platform_get_resource(dev, | 363 | struct resource *ccr = platform_get_resource(dev, |
diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c index 0488dd5ea2f7..440b5701cb8e 100644 --- a/drivers/mtd/nand/txx9ndfmc.c +++ b/drivers/mtd/nand/txx9ndfmc.c | |||
@@ -87,7 +87,7 @@ static struct platform_device *mtd_to_platdev(struct mtd_info *mtd) | |||
87 | static void __iomem *ndregaddr(struct platform_device *dev, unsigned int reg) | 87 | static void __iomem *ndregaddr(struct platform_device *dev, unsigned int reg) |
88 | { | 88 | { |
89 | struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev); | 89 | struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev); |
90 | struct txx9ndfmc_platform_data *plat = dev->dev.platform_data; | 90 | struct txx9ndfmc_platform_data *plat = dev_get_platdata(&dev->dev); |
91 | 91 | ||
92 | return drvdata->base + (reg << plat->shift); | 92 | return drvdata->base + (reg << plat->shift); |
93 | } | 93 | } |
@@ -138,7 +138,7 @@ static void txx9ndfmc_cmd_ctrl(struct mtd_info *mtd, int cmd, | |||
138 | struct nand_chip *chip = mtd->priv; | 138 | struct nand_chip *chip = mtd->priv; |
139 | struct txx9ndfmc_priv *txx9_priv = chip->priv; | 139 | struct txx9ndfmc_priv *txx9_priv = chip->priv; |
140 | struct platform_device *dev = txx9_priv->dev; | 140 | struct platform_device *dev = txx9_priv->dev; |
141 | struct txx9ndfmc_platform_data *plat = dev->dev.platform_data; | 141 | struct txx9ndfmc_platform_data *plat = dev_get_platdata(&dev->dev); |
142 | 142 | ||
143 | if (ctrl & NAND_CTRL_CHANGE) { | 143 | if (ctrl & NAND_CTRL_CHANGE) { |
144 | u32 mcr = txx9ndfmc_read(dev, TXX9_NDFMCR); | 144 | u32 mcr = txx9ndfmc_read(dev, TXX9_NDFMCR); |
@@ -225,7 +225,7 @@ static void txx9ndfmc_enable_hwecc(struct mtd_info *mtd, int mode) | |||
225 | 225 | ||
226 | static void txx9ndfmc_initialize(struct platform_device *dev) | 226 | static void txx9ndfmc_initialize(struct platform_device *dev) |
227 | { | 227 | { |
228 | struct txx9ndfmc_platform_data *plat = dev->dev.platform_data; | 228 | struct txx9ndfmc_platform_data *plat = dev_get_platdata(&dev->dev); |
229 | struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev); | 229 | struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev); |
230 | int tmout = 100; | 230 | int tmout = 100; |
231 | 231 | ||
@@ -274,7 +274,7 @@ static int txx9ndfmc_nand_scan(struct mtd_info *mtd) | |||
274 | 274 | ||
275 | static int __init txx9ndfmc_probe(struct platform_device *dev) | 275 | static int __init txx9ndfmc_probe(struct platform_device *dev) |
276 | { | 276 | { |
277 | struct txx9ndfmc_platform_data *plat = dev->dev.platform_data; | 277 | struct txx9ndfmc_platform_data *plat = dev_get_platdata(&dev->dev); |
278 | int hold, spw; | 278 | int hold, spw; |
279 | int i; | 279 | int i; |
280 | struct txx9ndfmc_drvdata *drvdata; | 280 | struct txx9ndfmc_drvdata *drvdata; |