diff options
Diffstat (limited to 'drivers/acpi/container.c')
-rw-r--r-- | drivers/acpi/container.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 1f9f7d7d7bc5..811910b50b75 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c | |||
@@ -92,17 +92,24 @@ static int is_device_present(acpi_handle handle) | |||
92 | return ((sta & ACPI_STA_DEVICE_PRESENT) == ACPI_STA_DEVICE_PRESENT); | 92 | return ((sta & ACPI_STA_DEVICE_PRESENT) == ACPI_STA_DEVICE_PRESENT); |
93 | } | 93 | } |
94 | 94 | ||
95 | static bool is_container_device(const char *hid) | ||
96 | { | ||
97 | const struct acpi_device_id *container_id; | ||
98 | |||
99 | for (container_id = container_device_ids; | ||
100 | container_id->id[0]; container_id++) { | ||
101 | if (!strcmp((char *)container_id->id, hid)) | ||
102 | return true; | ||
103 | } | ||
104 | |||
105 | return false; | ||
106 | } | ||
107 | |||
95 | /*******************************************************************/ | 108 | /*******************************************************************/ |
96 | static int acpi_container_add(struct acpi_device *device) | 109 | static int acpi_container_add(struct acpi_device *device) |
97 | { | 110 | { |
98 | struct acpi_container *container; | 111 | struct acpi_container *container; |
99 | 112 | ||
100 | |||
101 | if (!device) { | ||
102 | printk(KERN_ERR PREFIX "device is NULL\n"); | ||
103 | return -EINVAL; | ||
104 | } | ||
105 | |||
106 | container = kzalloc(sizeof(struct acpi_container), GFP_KERNEL); | 113 | container = kzalloc(sizeof(struct acpi_container), GFP_KERNEL); |
107 | if (!container) | 114 | if (!container) |
108 | return -ENOMEM; | 115 | return -ENOMEM; |
@@ -164,7 +171,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) | |||
164 | case ACPI_NOTIFY_BUS_CHECK: | 171 | case ACPI_NOTIFY_BUS_CHECK: |
165 | /* Fall through */ | 172 | /* Fall through */ |
166 | case ACPI_NOTIFY_DEVICE_CHECK: | 173 | case ACPI_NOTIFY_DEVICE_CHECK: |
167 | printk(KERN_WARNING "Container driver received %s event\n", | 174 | pr_debug("Container driver received %s event\n", |
168 | (type == ACPI_NOTIFY_BUS_CHECK) ? | 175 | (type == ACPI_NOTIFY_BUS_CHECK) ? |
169 | "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); | 176 | "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); |
170 | 177 | ||
@@ -185,7 +192,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) | |||
185 | 192 | ||
186 | result = container_device_add(&device, handle); | 193 | result = container_device_add(&device, handle); |
187 | if (result) { | 194 | if (result) { |
188 | printk(KERN_WARNING "Failed to add container\n"); | 195 | acpi_handle_warn(handle, "Failed to add container\n"); |
189 | break; | 196 | break; |
190 | } | 197 | } |
191 | 198 | ||
@@ -232,10 +239,8 @@ container_walk_namespace_cb(acpi_handle handle, | |||
232 | goto end; | 239 | goto end; |
233 | } | 240 | } |
234 | 241 | ||
235 | if (strcmp(hid, "ACPI0004") && strcmp(hid, "PNP0A05") && | 242 | if (!is_container_device(hid)) |
236 | strcmp(hid, "PNP0A06")) { | ||
237 | goto end; | 243 | goto end; |
238 | } | ||
239 | 244 | ||
240 | switch (*action) { | 245 | switch (*action) { |
241 | case INSTALL_NOTIFY_HANDLER: | 246 | case INSTALL_NOTIFY_HANDLER: |