]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
disk/part.c: Make features optional
authorMatthew McClintock <msm@freescale.com>
Tue, 24 May 2011 05:31:19 +0000 (05:31 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 26 Jul 2011 12:10:14 +0000 (14:10 +0200)
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>
common/cmd_ide.c
common/cmd_sata.c
common/cmd_scsi.c
common/usb_storage.c
disk/Makefile
drivers/block/mg_disk.c
drivers/block/systemace.c
drivers/mmc/mmc.c
include/config_defaults.h
include/part.h

index 7fbc05331001569bef457ddcd594d713718c8c0e..2e8c6e044a2962f72982b722bba96649da637fac 100644 (file)
@@ -719,10 +719,12 @@ void ide_init (void)
 
 /* ------------------------------------------------------------------------- */
 
+#ifdef CONFIG_PARTITIONS
 block_dev_desc_t * ide_get_dev(int dev)
 {
        return (dev < CONFIG_SYS_IDE_MAXDEVICE) ? &ide_dev_desc[dev] : NULL;
 }
+#endif
 
 
 #ifdef CONFIG_IDE_8xx_DIRECT
index 7efa8597ad4bb52eb0b232bc7737c8f325f26687..f62c0cb4f289887b01deeab12f6967a8f9665f64 100644 (file)
@@ -57,10 +57,12 @@ int __sata_initialize(void)
 }
 int sata_initialize(void) __attribute__((weak,alias("__sata_initialize")));
 
+#ifdef CONFIG_PARTITIONS
 block_dev_desc_t *sata_get_dev(int dev)
 {
        return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL;
 }
+#endif
 
 int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
index 8e8e93086903ab6c147dab3c21186c9cae84b3b7..fa10751b700c67836033de9fa8030dae11e9b9c6 100644 (file)
@@ -194,11 +194,12 @@ void scsi_init(void)
 }
 #endif
 
+#ifdef CONFIG_PARTITIONS
 block_dev_desc_t * scsi_get_dev(int dev)
 {
        return (dev < CONFIG_SYS_SCSI_MAX_DEVICE) ? &scsi_dev_desc[dev] : NULL;
 }
-
+#endif
 
 /******************************************************************************
  * scsi boot command intepreter. Derived from diskboot
index 9ecf165d1af0e443dcb0b67f3eb657a87541c841..16667f3948253d2b42d0101fbac6f3cc97fb1cf1 100644 (file)
@@ -173,11 +173,12 @@ unsigned long usb_stor_write(int device, unsigned long blknr,
 struct usb_device * usb_get_dev_index(int index);
 void uhci_show_temp_int_td(void);
 
+#ifdef CONFIG_PARTITIONS
 block_dev_desc_t *usb_stor_get_dev(int index)
 {
        return (index < usb_max_devs) ? &usb_dev_desc[index] : NULL;
 }
-
+#endif
 
 void usb_show_progress(void)
 {
index 17266a2eb67a663c42a8989fb693c005f1cbc475..5affe344ebdabdd614ea802574d83f59f76ded33 100644 (file)
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)libdisk.o
 
-COBJS-y += part.o
+COBJS-$(CONFIG_PARTITIONS)     += part.o
 COBJS-$(CONFIG_MAC_PARTITION)   += part_mac.o
 COBJS-$(CONFIG_DOS_PARTITION)   += part_dos.o
 COBJS-$(CONFIG_ISO_PARTITION)   += part_iso.o
index b74307ab6c49704c473c4ee44ca4b2d0917cda80..f9e175dcb830854cf573db9a9a0313b194e5b470 100644 (file)
@@ -522,10 +522,12 @@ mg_write_exit:
        return err;
 }
 
+#ifdef CONFIG_PARTITIONS
 block_dev_desc_t *mg_disk_get_dev(int dev)
 {
        return ((block_dev_desc_t *) & mg_disk_dev);
 }
+#endif
 
 /* must override this function */
 struct mg_drv_data * __attribute__((weak)) mg_get_drv_data (void)
index e8dff0acf6c0a9dd76e5dfed17a78603b3873fcc..58402b9289c4267d59697812acd720875220b4ea 100644 (file)
@@ -104,6 +104,7 @@ static void release_cf_lock(void)
        ace_writew((val & 0xffff), 0x18);
 }
 
+#ifdef CONFIG_PARTITIONS
 block_dev_desc_t *systemace_get_dev(int dev)
 {
        /* The first time through this, the systemace_dev object is
@@ -128,6 +129,7 @@ block_dev_desc_t *systemace_get_dev(int dev)
 
        return &systemace_dev;
 }
+#endif
 
 /*
  * This function is called (by dereferencing the block_read pointer in
index cbd75673b8b501b23bcea85c79253a7f737868f3..7e703c0ec6e293bc7ee5e19fcfe622161a7ee934 100644 (file)
@@ -1167,12 +1167,14 @@ int mmc_register(struct mmc *mmc)
        return 0;
 }
 
+#ifdef CONFIG_PARTITIONS
 block_dev_desc_t *mmc_get_dev(int dev)
 {
        struct mmc *mmc = find_mmc_device(dev);
 
        return mmc ? &mmc->block_dev : NULL;
 }
+#endif
 
 int mmc_init(struct mmc *mmc)
 {
index 0337163c2a21529a9d76639c51fe65bf40b4bada..d023c632d98288a777f119df0c84620be498f0dc 100644 (file)
@@ -16,5 +16,6 @@
 
 #define CONFIG_GZIP 1
 #define CONFIG_ZLIB 1
+#define CONFIG_PARTITIONS 1
 
 #endif
index 524351182904bdef5e01aa2fce55c3760f9f564f..182776791dce1ac757cdbefcbcf2d4cbc6dd6383 100644 (file)
@@ -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 */