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

« back to all changes in this revision

Viewing changes to drivers/mtd/onenand/generic.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:
30
30
 */
31
31
#define DRIVER_NAME     "onenand-flash"
32
32
 
33
 
#ifdef CONFIG_MTD_PARTITIONS
34
33
static const char *part_probes[] = { "cmdlinepart", NULL,  };
35
 
#endif
36
34
 
37
35
struct onenand_info {
38
36
        struct mtd_info         mtd;
75
73
                goto out_iounmap;
76
74
        }
77
75
 
78
 
#ifdef CONFIG_MTD_PARTITIONS
79
76
        err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
80
77
        if (err > 0)
81
 
                add_mtd_partitions(&info->mtd, info->parts, err);
 
78
                mtd_device_register(&info->mtd, info->parts, err);
82
79
        else if (err <= 0 && pdata && pdata->parts)
83
 
                add_mtd_partitions(&info->mtd, pdata->parts, pdata->nr_parts);
 
80
                mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts);
84
81
        else
85
 
#endif
86
 
                err = add_mtd_device(&info->mtd);
 
82
                err = mtd_device_register(&info->mtd, NULL, 0);
87
83
 
88
84
        platform_set_drvdata(pdev, info);
89
85
 
108
104
        platform_set_drvdata(pdev, NULL);
109
105
 
110
106
        if (info) {
111
 
                if (info->parts)
112
 
                        del_mtd_partitions(&info->mtd);
113
 
                else
114
 
                        del_mtd_device(&info->mtd);
115
 
 
 
107
                mtd_device_unregister(&info->mtd);
116
108
                onenand_release(&info->mtd);
117
109
                release_mem_region(res->start, size);
118
110
                iounmap(info->onenand.base);