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

« back to all changes in this revision

Viewing changes to drivers/mtd/nand/cs553x_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:
241
241
        /* Enable the following for a flash based bad block table */
242
242
        this->options = NAND_USE_FLASH_BBT | NAND_NO_AUTOINCR;
243
243
 
244
 
        /* Scan to find existance of the device */
 
244
        /* Scan to find existence of the device */
245
245
        if (nand_scan(new_mtd, 1)) {
246
246
                err = -ENXIO;
247
247
                goto out_ior;
277
277
        return 0;
278
278
}
279
279
 
280
 
 
281
 
#ifdef CONFIG_MTD_PARTITIONS
282
280
static const char *part_probes[] = { "cmdlinepart", NULL };
283
 
#endif
284
 
 
285
281
 
286
282
static int __init cs553x_init(void)
287
283
{
288
284
        int err = -ENXIO;
289
285
        int i;
290
286
        uint64_t val;
291
 
 
292
 
#ifdef CONFIG_MTD_PARTITIONS
293
287
        int mtd_parts_nb = 0;
294
288
        struct mtd_partition *mtd_parts = NULL;
295
 
#endif
296
289
 
297
290
        /* If the CPU isn't a Geode GX or LX, abort */
298
291
        if (!is_geode())
324
317
                if (cs553x_mtd[i]) {
325
318
 
326
319
                        /* If any devices registered, return success. Else the last error. */
327
 
#ifdef CONFIG_MTD_PARTITIONS
328
320
                        mtd_parts_nb = parse_mtd_partitions(cs553x_mtd[i], part_probes, &mtd_parts, 0);
329
 
                        if (mtd_parts_nb > 0) {
 
321
                        if (mtd_parts_nb > 0)
330
322
                                printk(KERN_NOTICE "Using command line partition definition\n");
331
 
                                add_mtd_partitions(cs553x_mtd[i], mtd_parts, mtd_parts_nb);
332
 
                        } else {
333
 
                                add_mtd_device(cs553x_mtd[i]);
334
 
                        }
335
 
#else
336
 
                        add_mtd_device(cs553x_mtd[i]);
337
 
#endif
 
323
                        mtd_device_register(cs553x_mtd[i], mtd_parts,
 
324
                                            mtd_parts_nb);
338
325
                        err = 0;
339
326
                }
340
327
        }