mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
mtd: fsl_elbc_nand: convert to mtd_device_register()
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS preprocessor conditionals as partitioning is always available. Signed-off-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
da499d414b
commit
ed9281e60a
@ -841,12 +841,9 @@ static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev)
|
|||||||
struct fsl_elbc_mtd *priv;
|
struct fsl_elbc_mtd *priv;
|
||||||
struct resource res;
|
struct resource res;
|
||||||
struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl;
|
struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl;
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
static const char *part_probe_types[]
|
static const char *part_probe_types[]
|
||||||
= { "cmdlinepart", "RedBoot", NULL };
|
= { "cmdlinepart", "RedBoot", NULL };
|
||||||
struct mtd_partition *parts;
|
struct mtd_partition *parts;
|
||||||
#endif
|
|
||||||
int ret;
|
int ret;
|
||||||
int bank;
|
int bank;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
@ -935,26 +932,19 @@ static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
/* First look for RedBoot table or partitions on the command
|
/* First look for RedBoot table or partitions on the command
|
||||||
* line, these take precedence over device tree information */
|
* line, these take precedence over device tree information */
|
||||||
ret = parse_mtd_partitions(&priv->mtd, part_probe_types, &parts, 0);
|
ret = parse_mtd_partitions(&priv->mtd, part_probe_types, &parts, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_OF_PARTS
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = of_mtd_parse_partitions(priv->dev, node, &parts);
|
ret = of_mtd_parse_partitions(priv->dev, node, &parts);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ret > 0)
|
mtd_device_register(&priv->mtd, parts, ret);
|
||||||
add_mtd_partitions(&priv->mtd, parts, ret);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
add_mtd_device(&priv->mtd);
|
|
||||||
|
|
||||||
printk(KERN_INFO "eLBC NAND device at 0x%llx, bank %d\n",
|
printk(KERN_INFO "eLBC NAND device at 0x%llx, bank %d\n",
|
||||||
(unsigned long long)res.start, priv->bank);
|
(unsigned long long)res.start, priv->bank);
|
||||||
|
Loading…
Reference in New Issue
Block a user