summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2013-02-28 15:03:46 +0000
committerTom Warren <twarren@nvidia.com>2013-03-14 11:06:44 -0700
commit2c1af9dcdcf4ede8d153c0918beca9067ec0eb36 (patch)
tree8f86cd1e5d351a6a731d8cbc0699b321941f46f4
parenta885f85214dcd358b29a2ffe69ab4f9b515b95e9 (diff)
downloadtalos-obmc-uboot-2c1af9dcdcf4ede8d153c0918beca9067ec0eb36.tar.gz
talos-obmc-uboot-2c1af9dcdcf4ede8d153c0918beca9067ec0eb36.zip
disk: define HAVE_BLOCK_DEVICE in a common place
This set of ifdefs is used in a number of places. Move its definition somewhere common so it doesn't have to be repeated. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Tom Rini <trini@ti.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
-rw-r--r--disk/part.c10
-rw-r--r--disk/part_amiga.c6
-rw-r--r--disk/part_dos.c7
-rw-r--r--disk/part_efi.c8
-rw-r--r--disk/part_iso.c7
-rw-r--r--disk/part_mac.c7
-rw-r--r--include/config_fallbacks.h10
7 files changed, 15 insertions, 40 deletions
diff --git a/disk/part.c b/disk/part.c
index 58a45637aa..d73625c443 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -35,16 +35,6 @@
#define PRINTF(fmt,args...)
#endif
-/* Rather than repeat this expression each time, add a define for it */
-#if (defined(CONFIG_CMD_IDE) || \
- defined(CONFIG_CMD_SATA) || \
- defined(CONFIG_CMD_SCSI) || \
- defined(CONFIG_CMD_USB) || \
- defined(CONFIG_MMC) || \
- defined(CONFIG_SYSTEMACE) )
-#define HAVE_BLOCK_DEVICE
-#endif
-
struct block_drvr {
char *name;
block_dev_desc_t* (*get_dev)(int dev);
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index dc7d46256d..0e6d82dbae 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -26,11 +26,7 @@
#include <ide.h>
#include "part_amiga.h"
-#if defined(CONFIG_CMD_IDE) || \
- defined(CONFIG_CMD_SCSI) || \
- defined(CONFIG_CMD_USB) || \
- defined(CONFIG_MMC) || \
- defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
#undef AMIGA_DEBUG
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 3fe901ba1b..37087a6ac3 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -35,12 +35,7 @@
#include <ide.h>
#include "part_dos.h"
-#if defined(CONFIG_CMD_IDE) || \
- defined(CONFIG_CMD_SATA) || \
- defined(CONFIG_CMD_SCSI) || \
- defined(CONFIG_CMD_USB) || \
- defined(CONFIG_MMC) || \
- defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
/* Convert char[4] in little endian format to the host format integer
*/
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 7665017330..b3fd0e954d 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -39,13 +39,7 @@
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_CMD_IDE) || \
- defined(CONFIG_CMD_SATA) || \
- defined(CONFIG_CMD_SCSI) || \
- defined(CONFIG_CMD_USB) || \
- defined(CONFIG_MMC) || \
- defined(CONFIG_SYSTEMACE)
-
+#ifdef HAVE_BLOCK_DEVICE
/**
* efi_crc32() - EFI version of crc32 function
* @buf: buffer to calculate crc32 of
diff --git a/disk/part_iso.c b/disk/part_iso.c
index 4401790af2..49639af269 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -25,12 +25,7 @@
#include <command.h>
#include "part_iso.h"
-#if defined(CONFIG_CMD_IDE) || \
- defined(CONFIG_CMD_SCSI) || \
- defined(CONFIG_CMD_SATA) || \
- defined(CONFIG_CMD_USB) || \
- defined(CONFIG_MMC) || \
- defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
/* #define ISO_PART_DEBUG */
diff --git a/disk/part_mac.c b/disk/part_mac.c
index cb443ac532..74dc12fe58 100644
--- a/disk/part_mac.c
+++ b/disk/part_mac.c
@@ -34,12 +34,7 @@
#include <ide.h>
#include "part_mac.h"
-#if defined(CONFIG_CMD_IDE) || \
- defined(CONFIG_CMD_SCSI) || \
- defined(CONFIG_CMD_SATA) || \
- defined(CONFIG_CMD_USB) || \
- defined(CONFIG_MMC) || \
- defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
/* stdlib.h causes some compatibility problems; should fixe these! -- wd */
#ifndef __ldiv_t_defined
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index bfb9680d68..653ff2b388 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -26,4 +26,14 @@
#define CONFIG_EXT4_WRITE
#endif
+/* Rather than repeat this expression each time, add a define for it */
+#if defined(CONFIG_CMD_IDE) || \
+ defined(CONFIG_CMD_SATA) || \
+ defined(CONFIG_CMD_SCSI) || \
+ defined(CONFIG_CMD_USB) || \
+ defined(CONFIG_MMC) || \
+ defined(CONFIG_SYSTEMACE)
+#define HAVE_BLOCK_DEVICE
+#endif
+
#endif /* __CONFIG_FALLBACKS_H */
OpenPOWER on IntegriCloud