So far, we have up to 4 different names for the same thing (ignoring capitalization)
CONFIG_FT2232SPI (makefile config option)
FT2232_SPI_SUPPORT (#define)
ft2232spi (programmer name)
ft2232_spi.c (programmer file)
Use CONFIG_* with underscores for makefile config options and #defines
and kill the useless _SUPPORT idiom.
Use lowercase names with underscores for programmer names and programmer
files.
With this, you can run "grep -i ft2232_spi" and find everything related
to the ft2232_spi driver. Same applies to all other programmers.
Corresponding to flashrom svn r1023.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
diff --git a/flashrom.c b/flashrom.c
index 071c52e..8a97454 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -38,9 +38,9 @@
char *chip_to_probe = NULL;
int verbose = 0;
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
enum programmer programmer = PROGRAMMER_INTERNAL;
-#elif DUMMY_SUPPORT == 1
+#elif CONFIG_DUMMY == 1
enum programmer programmer = PROGRAMMER_DUMMY;
#else
/* If neither internal nor dummy are selected, we must pick a sensible default.
@@ -48,39 +48,39 @@
* if more than one of them is selected. If only one is selected, it is clear
* that the user wants that one to become the default.
*/
-#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+ATAHPT_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT+DEDIPROG_SUPPORT+NICREALTEK_SUPPORT > 1
-#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all external programmers except one.
+#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT+CONFIG_FT2232_SPI+CONFIG_SERPROG+CONFIG_BUSPIRATE_SPI+CONFIG_DEDIPROG > 1
+#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all programmers except one.
#endif
enum programmer programmer =
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
PROGRAMMER_NIC3COM
#endif
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
PROGRAMMER_NICREALTEK
PROGRAMMER_NICREALTEK2
#endif
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
PROGRAMMER_GFXNVIDIA
#endif
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
PROGRAMMER_DRKAISER
#endif
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
PROGRAMMER_SATASII
#endif
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
PROGRAMMER_ATAHPT
#endif
-#if FT2232_SPI_SUPPORT == 1
- PROGRAMMER_FT2232SPI
+#if CONFIG_FT2232_SPI == 1
+ PROGRAMMER_FT2232_SPI
#endif
-#if SERPROG_SUPPORT == 1
+#if CONFIG_SERPROG == 1
PROGRAMMER_SERPROG
#endif
-#if BUSPIRATE_SPI_SUPPORT == 1
- PROGRAMMER_BUSPIRATESPI
+#if CONFIG_BUSPIRATE_SPI == 1
+ PROGRAMMER_BUSPIRATE_SPI
#endif
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
PROGRAMMER_DEDIPROG
#endif
;
@@ -107,7 +107,7 @@
};
const struct programmer_entry programmer_table[] = {
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
{
.name = "internal",
.init = internal_init,
@@ -126,7 +126,7 @@
},
#endif
-#if DUMMY_SUPPORT == 1
+#if CONFIG_DUMMY == 1
{
.name = "dummy",
.init = dummy_init,
@@ -145,7 +145,7 @@
},
#endif
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
{
.name = "nic3com",
.init = nic3com_init,
@@ -164,7 +164,7 @@
},
#endif
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
{
.name = "nicrealtek",
.init = nicrealtek_init,
@@ -200,7 +200,7 @@
#endif
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
{
.name = "gfxnvidia",
.init = gfxnvidia_init,
@@ -219,7 +219,7 @@
},
#endif
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
{
.name = "drkaiser",
.init = drkaiser_init,
@@ -238,7 +238,7 @@
},
#endif
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
{
.name = "satasii",
.init = satasii_init,
@@ -257,7 +257,7 @@
},
#endif
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
{
.name = "atahpt",
.init = atahpt_init,
@@ -276,7 +276,7 @@
},
#endif
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__)
{
.name = "it87spi",
@@ -297,9 +297,9 @@
#endif
#endif
-#if FT2232_SPI_SUPPORT == 1
+#if CONFIG_FT2232_SPI == 1
{
- .name = "ft2232spi",
+ .name = "ft2232_spi",
.init = ft2232_spi_init,
.shutdown = noop_shutdown, /* Missing shutdown */
.map_flash_region = fallback_map,
@@ -316,7 +316,7 @@
},
#endif
-#if SERPROG_SUPPORT == 1
+#if CONFIG_SERPROG == 1
{
.name = "serprog",
.init = serprog_init,
@@ -335,9 +335,9 @@
},
#endif
-#if BUSPIRATE_SPI_SUPPORT == 1
+#if CONFIG_BUSPIRATE_SPI == 1
{
- .name = "buspiratespi",
+ .name = "buspirate_spi",
.init = buspirate_spi_init,
.shutdown = buspirate_spi_shutdown,
.map_flash_region = fallback_map,
@@ -354,7 +354,7 @@
},
#endif
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
{
.name = "dediprog",
.init = dediprog_init,
@@ -1259,7 +1259,7 @@
msg_gerr("SPI programmer table miscompilation!\n");
ret = 1;
}
-#if BITBANG_SPI_SUPPORT == 1
+#if CONFIG_BITBANG_SPI == 1
if (bitbang_spi_master_count - 1 != BITBANG_SPI_INVALID) {
msg_gerr("Bitbanging SPI master table miscompilation!\n");
ret = 1;
@@ -1410,7 +1410,7 @@
}
numbytes = fread(buf, 1, size, image);
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
show_id(buf, size, force);
#endif
fclose(image);