Commit 2c1af9dcdcf4ede8d153c0918beca9067ec0eb36
Committed by
Tom Warren
1 parent
a885f85214
Exists in
master
and in
53 other branches
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>
Showing 7 changed files with 15 additions and 40 deletions Side-by-side Diff
disk/part.c
... | ... | @@ -35,16 +35,6 @@ |
35 | 35 | #define PRINTF(fmt,args...) |
36 | 36 | #endif |
37 | 37 | |
38 | -/* Rather than repeat this expression each time, add a define for it */ | |
39 | -#if (defined(CONFIG_CMD_IDE) || \ | |
40 | - defined(CONFIG_CMD_SATA) || \ | |
41 | - defined(CONFIG_CMD_SCSI) || \ | |
42 | - defined(CONFIG_CMD_USB) || \ | |
43 | - defined(CONFIG_MMC) || \ | |
44 | - defined(CONFIG_SYSTEMACE) ) | |
45 | -#define HAVE_BLOCK_DEVICE | |
46 | -#endif | |
47 | - | |
48 | 38 | struct block_drvr { |
49 | 39 | char *name; |
50 | 40 | block_dev_desc_t* (*get_dev)(int dev); |
disk/part_amiga.c
... | ... | @@ -26,11 +26,7 @@ |
26 | 26 | #include <ide.h> |
27 | 27 | #include "part_amiga.h" |
28 | 28 | |
29 | -#if defined(CONFIG_CMD_IDE) || \ | |
30 | - defined(CONFIG_CMD_SCSI) || \ | |
31 | - defined(CONFIG_CMD_USB) || \ | |
32 | - defined(CONFIG_MMC) || \ | |
33 | - defined(CONFIG_SYSTEMACE) | |
29 | +#ifdef HAVE_BLOCK_DEVICE | |
34 | 30 | |
35 | 31 | #undef AMIGA_DEBUG |
36 | 32 |
disk/part_dos.c
... | ... | @@ -35,12 +35,7 @@ |
35 | 35 | #include <ide.h> |
36 | 36 | #include "part_dos.h" |
37 | 37 | |
38 | -#if defined(CONFIG_CMD_IDE) || \ | |
39 | - defined(CONFIG_CMD_SATA) || \ | |
40 | - defined(CONFIG_CMD_SCSI) || \ | |
41 | - defined(CONFIG_CMD_USB) || \ | |
42 | - defined(CONFIG_MMC) || \ | |
43 | - defined(CONFIG_SYSTEMACE) | |
38 | +#ifdef HAVE_BLOCK_DEVICE | |
44 | 39 | |
45 | 40 | /* Convert char[4] in little endian format to the host format integer |
46 | 41 | */ |
disk/part_efi.c
... | ... | @@ -39,13 +39,7 @@ |
39 | 39 | |
40 | 40 | DECLARE_GLOBAL_DATA_PTR; |
41 | 41 | |
42 | -#if defined(CONFIG_CMD_IDE) || \ | |
43 | - defined(CONFIG_CMD_SATA) || \ | |
44 | - defined(CONFIG_CMD_SCSI) || \ | |
45 | - defined(CONFIG_CMD_USB) || \ | |
46 | - defined(CONFIG_MMC) || \ | |
47 | - defined(CONFIG_SYSTEMACE) | |
48 | - | |
42 | +#ifdef HAVE_BLOCK_DEVICE | |
49 | 43 | /** |
50 | 44 | * efi_crc32() - EFI version of crc32 function |
51 | 45 | * @buf: buffer to calculate crc32 of |
disk/part_iso.c
... | ... | @@ -25,12 +25,7 @@ |
25 | 25 | #include <command.h> |
26 | 26 | #include "part_iso.h" |
27 | 27 | |
28 | -#if defined(CONFIG_CMD_IDE) || \ | |
29 | - defined(CONFIG_CMD_SCSI) || \ | |
30 | - defined(CONFIG_CMD_SATA) || \ | |
31 | - defined(CONFIG_CMD_USB) || \ | |
32 | - defined(CONFIG_MMC) || \ | |
33 | - defined(CONFIG_SYSTEMACE) | |
28 | +#ifdef HAVE_BLOCK_DEVICE | |
34 | 29 | |
35 | 30 | /* #define ISO_PART_DEBUG */ |
36 | 31 |
disk/part_mac.c
... | ... | @@ -34,12 +34,7 @@ |
34 | 34 | #include <ide.h> |
35 | 35 | #include "part_mac.h" |
36 | 36 | |
37 | -#if defined(CONFIG_CMD_IDE) || \ | |
38 | - defined(CONFIG_CMD_SCSI) || \ | |
39 | - defined(CONFIG_CMD_SATA) || \ | |
40 | - defined(CONFIG_CMD_USB) || \ | |
41 | - defined(CONFIG_MMC) || \ | |
42 | - defined(CONFIG_SYSTEMACE) | |
37 | +#ifdef HAVE_BLOCK_DEVICE | |
43 | 38 | |
44 | 39 | /* stdlib.h causes some compatibility problems; should fixe these! -- wd */ |
45 | 40 | #ifndef __ldiv_t_defined |
include/config_fallbacks.h
... | ... | @@ -26,5 +26,15 @@ |
26 | 26 | #define CONFIG_EXT4_WRITE |
27 | 27 | #endif |
28 | 28 | |
29 | +/* Rather than repeat this expression each time, add a define for it */ | |
30 | +#if defined(CONFIG_CMD_IDE) || \ | |
31 | + defined(CONFIG_CMD_SATA) || \ | |
32 | + defined(CONFIG_CMD_SCSI) || \ | |
33 | + defined(CONFIG_CMD_USB) || \ | |
34 | + defined(CONFIG_MMC) || \ | |
35 | + defined(CONFIG_SYSTEMACE) | |
36 | +#define HAVE_BLOCK_DEVICE | |
37 | +#endif | |
38 | + | |
29 | 39 | #endif /* __CONFIG_FALLBACKS_H */ |