diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-03-04 15:01:41 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-03-20 09:16:44 -0400 |
commit | a4b6d516a6079c6ba8dc97d185371439035a35d0 (patch) | |
tree | b53616a18b80d9d35a865ece4d4e3711c8dea074 /drivers/mtd/devices/mtd_dataflash.c | |
parent | 7ed8c7d440d497913a2218831a67b5897e0e86e1 (diff) |
[MTD] partitioning utility predicates
Move mtd_has_partitions() and mtd_has_cmdlinepart() inlines from a
DaVinci-specific driver to the <linux/mtd/partitions.h> header.
Use those to eliminate #ifdefs in two drivers which had their own
definitions of mtd_has_partitions().
Quite a lot of other MTD drivers could benefit from using use one or both
of these to remove #ifdeffery. Maybe some Janitors would like to help.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices/mtd_dataflash.c')
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 6d9f810565c8..d95f74a93bce 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -98,12 +98,6 @@ struct dataflash { | |||
98 | struct mtd_info mtd; | 98 | struct mtd_info mtd; |
99 | }; | 99 | }; |
100 | 100 | ||
101 | #ifdef CONFIG_MTD_PARTITIONS | ||
102 | #define mtd_has_partitions() (1) | ||
103 | #else | ||
104 | #define mtd_has_partitions() (0) | ||
105 | #endif | ||
106 | |||
107 | /* ......................................................................... */ | 101 | /* ......................................................................... */ |
108 | 102 | ||
109 | /* | 103 | /* |
@@ -682,11 +676,13 @@ add_dataflash_otp(struct spi_device *spi, char *name, | |||
682 | struct mtd_partition *parts; | 676 | struct mtd_partition *parts; |
683 | int nr_parts = 0; | 677 | int nr_parts = 0; |
684 | 678 | ||
685 | #ifdef CONFIG_MTD_CMDLINE_PARTS | 679 | if (mtd_has_cmdlinepart()) { |
686 | static const char *part_probes[] = { "cmdlinepart", NULL, }; | 680 | static const char *part_probes[] |
681 | = { "cmdlinepart", NULL, }; | ||
687 | 682 | ||
688 | nr_parts = parse_mtd_partitions(device, part_probes, &parts, 0); | 683 | nr_parts = parse_mtd_partitions(device, |
689 | #endif | 684 | part_probes, &parts, 0); |
685 | } | ||
690 | 686 | ||
691 | if (nr_parts <= 0 && pdata && pdata->parts) { | 687 | if (nr_parts <= 0 && pdata && pdata->parts) { |
692 | parts = pdata->parts; | 688 | parts = pdata->parts; |