9
0
Fork 0

drivers/nor/cfi_flash: use IS_ENABLED instead of an ifdef

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jan Luebbe 2012-09-10 10:55:47 +02:00 committed by Sascha Hauer
parent 68bc34d416
commit aa577bfc6d
2 changed files with 3 additions and 7 deletions

View File

@ -917,7 +917,6 @@ struct file_operations cfi_ops = {
.memmap = generic_memmap_ro,
};
#ifdef CONFIG_PARTITION_NEED_MTD
static int cfi_mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{
@ -977,7 +976,6 @@ static void cfi_init_mtd(struct flash_info *info)
mtd->flags = MTD_CAP_NORFLASH;
info->cdev.mtd = mtd;
}
#endif
static int cfi_probe (struct device_d *dev)
{
@ -1006,9 +1004,9 @@ static int cfi_probe (struct device_d *dev)
info->cdev.ops = &cfi_ops;
info->cdev.priv = info;
#ifdef CONFIG_PARTITION_NEED_MTD
cfi_init_mtd(info);
#endif
if (IS_ENABLED(CONFIG_PARTITION_NEED_MTD))
cfi_init_mtd(info);
devfs_create(&info->cdev);
return 0;

View File

@ -75,9 +75,7 @@ struct flash_info {
ulong addr_unlock2; /* unlock address 2 for AMD flash roms */
struct cfi_cmd_set *cfi_cmd_set;
struct cdev cdev;
#ifdef CONFIG_PARTITION_NEED_MTD
struct mtd_info mtd;
#endif
int numeraseregions;
struct mtd_erase_region_info *eraseregions;
void *base;