summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthew McClintock <msm@freescale.com>2011-05-24 05:31:19 +0000
committerWolfgang Denk <wd@denx.de>2011-07-26 14:10:14 +0200
commitdf3fc52608daa1e10332f59cd2f226ba400d1c98 (patch)
tree0c614241f09bc6055cbb5855feeaaeeeca975ce5 /include
parent07c07635b4f6d4ee2a03cd508beeeaccde4b9d7e (diff)
downloadu-boot-imx-df3fc52608daa1e10332f59cd2f226ba400d1c98.zip
u-boot-imx-df3fc52608daa1e10332f59cd2f226ba400d1c98.tar.gz
u-boot-imx-df3fc52608daa1e10332f59cd2f226ba400d1c98.tar.bz2
disk/part.c: Make features optional
If we don't want to build support for any partition types we can now add #undef CONFIG_PARTITIONS in a board config file to keep this from being compiled in. Otherwise boards assume this is compiled in by default Signed-off-by: Matthew McClintock <msm@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/config_defaults.h1
-rw-r--r--include/part.h18
2 files changed, 18 insertions, 1 deletions
diff --git a/include/config_defaults.h b/include/config_defaults.h
index 0337163..d023c63 100644
--- a/include/config_defaults.h
+++ b/include/config_defaults.h
@@ -16,5 +16,6 @@
#define CONFIG_GZIP 1
#define CONFIG_ZLIB 1
+#define CONFIG_PARTITIONS 1
#endif
diff --git a/include/part.h b/include/part.h
index 5243511..1827767 100644
--- a/include/part.h
+++ b/include/part.h
@@ -96,6 +96,7 @@ typedef struct disk_partition {
} disk_partition_t;
/* Misc _get_dev functions */
+#ifdef CONFIG_PARTITIONS
block_dev_desc_t* get_dev(char* ifname, int dev);
block_dev_desc_t* ide_get_dev(int dev);
block_dev_desc_t* sata_get_dev(int dev);
@@ -110,7 +111,22 @@ int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t
void print_part (block_dev_desc_t *dev_desc);
void init_part (block_dev_desc_t *dev_desc);
void dev_print(block_dev_desc_t *dev_desc);
-
+#else
+static inline block_dev_desc_t* get_dev(char* ifname, int dev) { return NULL; }
+static inline block_dev_desc_t* ide_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t* sata_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t* scsi_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t* usb_stor_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t* mmc_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t* systemace_get_dev(int dev) { return NULL; }
+static inline block_dev_desc_t* mg_disk_get_dev(int dev) { return NULL; }
+
+static inline int get_partition_info (block_dev_desc_t * dev_desc, int part,
+ disk_partition_t *info) { return -1; }
+static inline void print_part (block_dev_desc_t *dev_desc) {}
+static inline void init_part (block_dev_desc_t *dev_desc) {}
+static inline void dev_print(block_dev_desc_t *dev_desc) {}
+#endif
#ifdef CONFIG_MAC_PARTITION
/* disk/part_mac.c */