Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102134361
D47448.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47448.diff
View Options
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);
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 1:14 AM (14 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14476441
Default Alt Text
D47448.diff (1 KB)
Attached To
Mode
D47448: iichid: Fix layout of PNP ids
Attached
Detach File
Event Timeline
Log In to Comment