aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2009-12-14 17:11:44 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-12-31 15:47:24 -0500
commit448791abfb64f097e6d6c5f71df68fd072def5b3 (patch)
tree2edd5121acef672ac2c4068cbe7fb5c4dcbfd874 /drivers/mtd
parentfc161c4e8ec9b12d42b10d510a9de8562ea3afac (diff)
mtd: tmio_nand.c: use dev_get_platdata() and resource_size()
Remove unnecessary casts and use dev_get_platdata() to retrieve the struct mfd_cell data from the platform. Use resource_size() for the ioremap()'s. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/tmio_nand.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c
index 92c73344a669..65fa46957dbb 100644
--- a/drivers/mtd/nand/tmio_nand.c
+++ b/drivers/mtd/nand/tmio_nand.c
@@ -318,7 +318,7 @@ static int tmio_nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
318 318
319static int tmio_hw_init(struct platform_device *dev, struct tmio_nand *tmio) 319static int tmio_hw_init(struct platform_device *dev, struct tmio_nand *tmio)
320{ 320{
321 struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; 321 struct mfd_cell *cell = dev_get_platdata(&dev->dev);
322 int ret; 322 int ret;
323 323
324 if (cell->enable) { 324 if (cell->enable) {
@@ -362,7 +362,7 @@ static int tmio_hw_init(struct platform_device *dev, struct tmio_nand *tmio)
362 362
363static void tmio_hw_stop(struct platform_device *dev, struct tmio_nand *tmio) 363static void tmio_hw_stop(struct platform_device *dev, struct tmio_nand *tmio)
364{ 364{
365 struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; 365 struct mfd_cell *cell = dev_get_platdata(&dev->dev);
366 366
367 tmio_iowrite8(FCR_MODE_POWER_OFF, tmio->fcr + FCR_MODE); 367 tmio_iowrite8(FCR_MODE_POWER_OFF, tmio->fcr + FCR_MODE);
368 if (cell->disable) 368 if (cell->disable)
@@ -371,7 +371,7 @@ static void tmio_hw_stop(struct platform_device *dev, struct tmio_nand *tmio)
371 371
372static int tmio_probe(struct platform_device *dev) 372static int tmio_probe(struct platform_device *dev)
373{ 373{
374 struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; 374 struct mfd_cell *cell = dev_get_platdata(&dev->dev);
375 struct tmio_nand_data *data = cell->driver_data; 375 struct tmio_nand_data *data = cell->driver_data;
376 struct resource *fcr = platform_get_resource(dev, 376 struct resource *fcr = platform_get_resource(dev,
377 IORESOURCE_MEM, 0); 377 IORESOURCE_MEM, 0);
@@ -404,14 +404,14 @@ static int tmio_probe(struct platform_device *dev)
404 mtd->priv = nand_chip; 404 mtd->priv = nand_chip;
405 mtd->name = "tmio-nand"; 405 mtd->name = "tmio-nand";
406 406
407 tmio->ccr = ioremap(ccr->start, ccr->end - ccr->start + 1); 407 tmio->ccr = ioremap(ccr->start, resource_size(ccr));
408 if (!tmio->ccr) { 408 if (!tmio->ccr) {
409 retval = -EIO; 409 retval = -EIO;
410 goto err_iomap_ccr; 410 goto err_iomap_ccr;
411 } 411 }
412 412
413 tmio->fcr_base = fcr->start & 0xfffff; 413 tmio->fcr_base = fcr->start & 0xfffff;
414 tmio->fcr = ioremap(fcr->start, fcr->end - fcr->start + 1); 414 tmio->fcr = ioremap(fcr->start, resource_size(fcr));
415 if (!tmio->fcr) { 415 if (!tmio->fcr) {
416 retval = -EIO; 416 retval = -EIO;
417 goto err_iomap_fcr; 417 goto err_iomap_fcr;
@@ -515,7 +515,7 @@ static int tmio_remove(struct platform_device *dev)
515#ifdef CONFIG_PM 515#ifdef CONFIG_PM
516static int tmio_suspend(struct platform_device *dev, pm_message_t state) 516static int tmio_suspend(struct platform_device *dev, pm_message_t state)
517{ 517{
518 struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; 518 struct mfd_cell *cell = dev_get_platdata(&dev->dev);
519 519
520 if (cell->suspend) 520 if (cell->suspend)
521 cell->suspend(dev); 521 cell->suspend(dev);
@@ -526,7 +526,7 @@ static int tmio_suspend(struct platform_device *dev, pm_message_t state)
526 526
527static int tmio_resume(struct platform_device *dev) 527static int tmio_resume(struct platform_device *dev)
528{ 528{
529 struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; 529 struct mfd_cell *cell = dev_get_platdata(&dev->dev);
530 530
531 /* FIXME - is this required or merely another attack of the broken 531 /* FIXME - is this required or merely another attack of the broken
532 * SHARP platform? Looks suspicious. 532 * SHARP platform? Looks suspicious.