diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -132,14 +132,18 @@ #define IICHID_REG_ACPI (UINT16_MAX + 1) #define IICHID_REG_ELAN 0x0001 -static const struct iichid_id { - char *id; - int reg; -} iichid_ids[] = { - { "ELAN0000", IICHID_REG_ELAN }, - { "PNP0C50", IICHID_REG_ACPI }, - { "ACPI0C50", IICHID_REG_ACPI }, - { NULL, 0 }, +static char * iichid_ids[] = { + "ELAN0000", + "PNP0C50", + "ACPI0C50", + NULL, +}; + +static int iichid_regs[] = { + IICHID_REG_ELAN, + IICHID_REG_ACPI, + IICHID_REG_ACPI, + IICHID_REG_NONE, }; enum iichid_powerstate_how { @@ -208,17 +212,16 @@ static inline int acpi_is_iichid(ACPI_HANDLE handle) { - const struct iichid_id *ids; UINT32 sta; - int reg; + int i, reg = IICHID_REG_NONE; - for (ids = iichid_ids; ids->id != NULL; ids++) { - if (acpi_MatchHid(handle, ids->id)) { - reg = ids->reg; + for (i = 0; i < nitems(iichid_ids); i++) { + if (acpi_MatchHid(handle, iichid_ids[i])) { + reg = iichid_regs[i]; break; } } - if (ids->id == NULL) + if (reg == IICHID_REG_NONE) return (IICHID_REG_NONE); /*