~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/mtd/nand/tmio_nand.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Slightly murky pre-git history of the driver:
5
5
 *
6
6
 * Copyright (c) Ian Molton 2004, 2005, 2008
7
 
 *    Original work, independant of sharps code. Included hardware ECC support.
 
7
 *    Original work, independent of sharps code. Included hardware ECC support.
8
8
 *    Hard ECC did not work for writes in the early revisions.
9
9
 * Copyright (c) Dirk Opfer 2005.
10
10
 *    Modifications developed from sharps code but
372
372
 
373
373
static int tmio_probe(struct platform_device *dev)
374
374
{
375
 
        struct tmio_nand_data *data = mfd_get_data(dev);
 
375
        struct tmio_nand_data *data = dev->dev.platform_data;
376
376
        struct resource *fcr = platform_get_resource(dev,
377
377
                        IORESOURCE_MEM, 0);
378
378
        struct resource *ccr = platform_get_resource(dev,
381
381
        struct tmio_nand *tmio;
382
382
        struct mtd_info *mtd;
383
383
        struct nand_chip *nand_chip;
384
 
#ifdef CONFIG_MTD_PARTITIONS
385
384
        struct mtd_partition *parts;
386
385
        int nbparts = 0;
387
 
#endif
388
386
        int retval;
389
387
 
390
388
        if (data == NULL)
463
461
                goto err_scan;
464
462
        }
465
463
        /* Register the partitions */
466
 
#ifdef CONFIG_MTD_PARTITIONS
467
464
#ifdef CONFIG_MTD_CMDLINE_PARTS
468
465
        nbparts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
469
466
#endif
472
469
                nbparts = data->num_partitions;
473
470
        }
474
471
 
475
 
        if (nbparts)
476
 
                retval = add_mtd_partitions(mtd, parts, nbparts);
477
 
        else
478
 
#endif
479
 
        retval = add_mtd_device(mtd);
480
 
 
 
472
        retval = mtd_device_register(mtd, parts, nbparts);
481
473
        if (!retval)
482
474
                return retval;
483
475