aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/m25p80.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-03-04 15:01:41 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-03-20 09:16:44 -0400
commita4b6d516a6079c6ba8dc97d185371439035a35d0 (patch)
treeb53616a18b80d9d35a865ece4d4e3711c8dea074 /drivers/mtd/devices/m25p80.c
parent7ed8c7d440d497913a2218831a67b5897e0e86e1 (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/m25p80.c')
-rw-r--r--drivers/mtd/devices/m25p80.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 7c3fc766dcf1..98b0faf6696d 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -65,12 +65,6 @@
65#define FAST_READ_DUMMY_BYTE 0 65#define FAST_READ_DUMMY_BYTE 0
66#endif 66#endif
67 67
68#ifdef CONFIG_MTD_PARTITIONS
69#define mtd_has_partitions() (1)
70#else
71#define mtd_has_partitions() (0)
72#endif
73
74/****************************************************************************/ 68/****************************************************************************/
75 69
76struct m25p { 70struct m25p {
@@ -708,12 +702,13 @@ static int __devinit m25p_probe(struct spi_device *spi)
708 struct mtd_partition *parts = NULL; 702 struct mtd_partition *parts = NULL;
709 int nr_parts = 0; 703 int nr_parts = 0;
710 704
711#ifdef CONFIG_MTD_CMDLINE_PARTS 705 if (mtd_has_cmdlinepart()) {
712 static const char *part_probes[] = { "cmdlinepart", NULL, }; 706 static const char *part_probes[]
707 = { "cmdlinepart", NULL, };
713 708
714 nr_parts = parse_mtd_partitions(&flash->mtd, 709 nr_parts = parse_mtd_partitions(&flash->mtd,
715 part_probes, &parts, 0); 710 part_probes, &parts, 0);
716#endif 711 }
717 712
718 if (nr_parts <= 0 && data && data->parts) { 713 if (nr_parts <= 0 && data && data->parts) {
719 parts = data->parts; 714 parts = data->parts;