summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-08-31 16:19:50 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-08-31 16:19:50 +0000
commit0733ab030aa1bd9fb0e083c842cff28dd468e5f6 (patch)
tree81c4d21919d2bb35c7d74d628ad4e338543ad9f8
parent5044a90d5f3ccda9c92a6ede98edb4657a6fb04b (diff)
downloadflashrom-0733ab030aa1bd9fb0e083c842cff28dd468e5f6.zip
flashrom-0733ab030aa1bd9fb0e083c842cff28dd468e5f6.tar.gz
Shorten some board enable related function names
Corresponding to flashrom svn r1424. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
-rw-r--r--board_enable.c29
-rw-r--r--flashrom.c2
-rw-r--r--print.c4
-rw-r--r--print_wiki.c2
-rw-r--r--programmer.h4
5 files changed, 20 insertions, 21 deletions
diff --git a/board_enable.c b/board_enable.c
index 72f4cfe..ee5d969 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -1974,7 +1974,7 @@ static int it8712f_gpio3_1_raise(void)
*/
/* Please keep this list alphabetically ordered by vendor/board name. */
-const struct board_pciid_enable board_pciid_enables[] = {
+const struct board_match board_matches[] = {
/* first pci-id set [4], second pci-id set [4], dmi identifier, coreboot id [2], phase, vendor name, board name max_rom_... OK? flash enable */
#if defined(__i386__) || defined(__x86_64__)
@@ -2102,11 +2102,11 @@ const struct board_pciid_enable board_pciid_enables[] = {
* Match boards on coreboot table gathered vendor and part name.
* Require main PCI IDs to match too as extra safety.
*/
-static const struct board_pciid_enable *board_match_coreboot_name(
- const char *vendor, const char *part)
+static const struct board_match *board_match_cbname(const char *vendor,
+ const char *part)
{
- const struct board_pciid_enable *board = board_pciid_enables;
- const struct board_pciid_enable *partmatch = NULL;
+ const struct board_match *board = board_matches;
+ const struct board_match *partmatch = NULL;
for (; board->vendor_name; board++) {
if (vendor && (!board->lb_vendor
@@ -2153,12 +2153,11 @@ static const struct board_pciid_enable *board_match_coreboot_name(
/*
* Match boards on PCI IDs and subsystem IDs.
- * Second set of IDs can be main only or missing completely.
+ * Second set of IDs can be either main+subsystem IDs, main IDs or no IDs.
*/
-const static struct board_pciid_enable *board_match_pci_card_ids(
- enum board_match_phase phase)
+const static struct board_match *board_match_pci_ids(enum board_match_phase phase)
{
- const struct board_pciid_enable *board = board_pciid_enables;
+ const struct board_match *board = board_matches;
for (; board->vendor_name; board++) {
if ((!board->first_card_vendor || !board->first_card_device) &&
@@ -2204,7 +2203,7 @@ const static struct board_pciid_enable *board_match_pci_card_ids(
return NULL;
}
-static int unsafe_board_handler(const struct board_pciid_enable *board)
+static int unsafe_board_handler(const struct board_match *board)
{
if (!board)
return 1;
@@ -2231,9 +2230,9 @@ static int unsafe_board_handler(const struct board_pciid_enable *board)
/* FIXME: Should this be identical to board_flash_enable? */
static int board_handle_phase(enum board_match_phase phase)
{
- const struct board_pciid_enable *board = NULL;
+ const struct board_match *board = NULL;
- board = board_match_pci_card_ids(phase);
+ board = board_match_pci_ids(phase);
if (unsafe_board_handler(board))
board = NULL;
@@ -2262,14 +2261,14 @@ void board_handle_before_laptop(void)
int board_flash_enable(const char *vendor, const char *part)
{
- const struct board_pciid_enable *board = NULL;
+ const struct board_match *board = NULL;
int ret = 0;
if (part)
- board = board_match_coreboot_name(vendor, part);
+ board = board_match_cbname(vendor, part);
if (!board)
- board = board_match_pci_card_ids(P3);
+ board = board_match_pci_ids(P3);
if (unsafe_board_handler(board))
board = NULL;
diff --git a/flashrom.c b/flashrom.c
index d897ac7..c9d1e61 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1731,7 +1731,7 @@ int selfcheck(void)
msg_gerr("Chipset enables table does not exist!\n");
ret = 1;
}
- if (board_pciid_enables == NULL) {
+ if (board_matches == NULL) {
msg_gerr("Board enables table does not exist!\n");
ret = 1;
}
diff --git a/print.c b/print.c
index f0bd477..5bd75ec 100644
--- a/print.c
+++ b/print.c
@@ -203,7 +203,7 @@ static void print_supported_boards_helper(const struct board_info *boards,
const char *devicetype)
{
int i, boardcount_good = 0, boardcount_bad = 0;
- const struct board_pciid_enable *e = board_pciid_enables;
+ const struct board_match *e = board_matches;
const struct board_info *b = boards;
int maxvendorlen = strlen("Vendor") + 1;
int maxboardlen = strlen("Board") + 1;
@@ -241,7 +241,7 @@ static void print_supported_boards_helper(const struct board_info *boards,
msg_ginfo(" ");
msg_ginfo((b->working) ? "OK " : "BAD ");
- for (e = board_pciid_enables; e->vendor_name != NULL; e++) {
+ for (e = board_matches; e->vendor_name != NULL; e++) {
if (strcmp(e->vendor_name, b->vendor)
|| strcmp(e->board_name, b->name))
continue;
diff --git a/print_wiki.c b/print_wiki.c
index b70da86..74479a5 100644
--- a/print_wiki.c
+++ b/print_wiki.c
@@ -125,7 +125,7 @@ static void wiki_helper(const char *devicetype, int cols,
int num_notes = 0;
char *notes = calloc(1, 1);
char tmp[900 + 1];
- const struct board_pciid_enable *b = board_pciid_enables;
+ const struct board_match *b = board_matches;
for (i = 0; boards[i].vendor != NULL; i++) {
if (boards[i].working)
diff --git a/programmer.h b/programmer.h
index 6a28dbe..664bd9c 100644
--- a/programmer.h
+++ b/programmer.h
@@ -158,7 +158,7 @@ enum board_match_phase {
P3
};
-struct board_pciid_enable {
+struct board_match {
/* Any device, but make it sensible, like the ISA bridge. */
uint16_t first_vendor;
uint16_t first_device;
@@ -190,7 +190,7 @@ struct board_pciid_enable {
int (*enable) (void); /* May be NULL. */
};
-extern const struct board_pciid_enable board_pciid_enables[];
+extern const struct board_match board_matches[];
struct board_info {
const char *vendor;
OpenPOWER on IntegriCloud