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

« back to all changes in this revision

Viewing changes to drivers/mtd/nand/sharpsl.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:
103
103
        return readb(sharpsl->io + ECCCNTR) != 0;
104
104
}
105
105
 
106
 
#ifdef CONFIG_MTD_PARTITIONS
107
106
static const char *part_probes[] = { "cmdlinepart", NULL };
108
 
#endif
109
107
 
110
108
/*
111
109
 * Main initialization routine
113
111
static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
114
112
{
115
113
        struct nand_chip *this;
116
 
#ifdef CONFIG_MTD_PARTITIONS
117
114
        struct mtd_partition *sharpsl_partition_info;
118
115
        int nr_partitions;
119
 
#endif
120
116
        struct resource *r;
121
117
        int err = 0;
122
118
        struct sharpsl_nand *sharpsl;
188
184
 
189
185
        /* Register the partitions */
190
186
        sharpsl->mtd.name = "sharpsl-nand";
191
 
#ifdef CONFIG_MTD_PARTITIONS
192
187
        nr_partitions = parse_mtd_partitions(&sharpsl->mtd, part_probes, &sharpsl_partition_info, 0);
193
188
        if (nr_partitions <= 0) {
194
189
                nr_partitions = data->nr_partitions;
195
190
                sharpsl_partition_info = data->partitions;
196
191
        }
197
192
 
198
 
        if (nr_partitions > 0)
199
 
                err = add_mtd_partitions(&sharpsl->mtd, sharpsl_partition_info, nr_partitions);
200
 
        else
201
 
#endif
202
 
        err = add_mtd_device(&sharpsl->mtd);
 
193
        err = mtd_device_register(&sharpsl->mtd, sharpsl_partition_info,
 
194
                                  nr_partitions);
203
195
        if (err)
204
196
                goto err_add;
205
197