diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-11 13:24:45 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-11 13:24:45 -0400 |
commit | 438145c7ef5c9445f25bb8fc4d52e2c9d11fdc7c (patch) | |
tree | 76941991e36f4a32bf1be0db3854959053f24619 /drivers/pnp/pnpacpi | |
parent | 9ddd1b8ad8abd321964b8add5581910de6d67c2a (diff) |
Update from 2.6.36 to 2.6.36.4wip-dissipation-jerickso
Diffstat (limited to 'drivers/pnp/pnpacpi')
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index dc4e32e031e9..0d943eea1c2d 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "../base.h" | 28 | #include "../base.h" |
29 | #include "pnpacpi.h" | 29 | #include "pnpacpi.h" |
30 | 30 | ||
31 | static int num = 0; | 31 | static int num; |
32 | 32 | ||
33 | /* We need only to blacklist devices that have already an acpi driver that | 33 | /* We need only to blacklist devices that have already an acpi driver that |
34 | * can't use pnp layer. We don't need to blacklist device that are directly | 34 | * can't use pnp layer. We don't need to blacklist device that are directly |
@@ -180,11 +180,24 @@ struct pnp_protocol pnpacpi_protocol = { | |||
180 | }; | 180 | }; |
181 | EXPORT_SYMBOL(pnpacpi_protocol); | 181 | EXPORT_SYMBOL(pnpacpi_protocol); |
182 | 182 | ||
183 | static char *pnpacpi_get_id(struct acpi_device *device) | ||
184 | { | ||
185 | struct acpi_hardware_id *id; | ||
186 | |||
187 | list_for_each_entry(id, &device->pnp.ids, list) { | ||
188 | if (ispnpidacpi(id->id)) | ||
189 | return id->id; | ||
190 | } | ||
191 | |||
192 | return NULL; | ||
193 | } | ||
194 | |||
183 | static int __init pnpacpi_add_device(struct acpi_device *device) | 195 | static int __init pnpacpi_add_device(struct acpi_device *device) |
184 | { | 196 | { |
185 | acpi_handle temp = NULL; | 197 | acpi_handle temp = NULL; |
186 | acpi_status status; | 198 | acpi_status status; |
187 | struct pnp_dev *dev; | 199 | struct pnp_dev *dev; |
200 | char *pnpid; | ||
188 | struct acpi_hardware_id *id; | 201 | struct acpi_hardware_id *id; |
189 | 202 | ||
190 | /* | 203 | /* |
@@ -192,11 +205,17 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
192 | * driver should not be loaded. | 205 | * driver should not be loaded. |
193 | */ | 206 | */ |
194 | status = acpi_get_handle(device->handle, "_CRS", &temp); | 207 | status = acpi_get_handle(device->handle, "_CRS", &temp); |
195 | if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) || | 208 | if (ACPI_FAILURE(status)) |
196 | is_exclusive_device(device) || (!device->status.present)) | 209 | return 0; |
210 | |||
211 | pnpid = pnpacpi_get_id(device); | ||
212 | if (!pnpid) | ||
213 | return 0; | ||
214 | |||
215 | if (is_exclusive_device(device) || !device->status.present) | ||
197 | return 0; | 216 | return 0; |
198 | 217 | ||
199 | dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device)); | 218 | dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid); |
200 | if (!dev) | 219 | if (!dev) |
201 | return -ENOMEM; | 220 | return -ENOMEM; |
202 | 221 | ||
@@ -227,7 +246,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
227 | pnpacpi_parse_resource_option_data(dev); | 246 | pnpacpi_parse_resource_option_data(dev); |
228 | 247 | ||
229 | list_for_each_entry(id, &device->pnp.ids, list) { | 248 | list_for_each_entry(id, &device->pnp.ids, list) { |
230 | if (!strcmp(id->id, acpi_device_hid(device))) | 249 | if (!strcmp(id->id, pnpid)) |
231 | continue; | 250 | continue; |
232 | if (!ispnpidacpi(id->id)) | 251 | if (!ispnpidacpi(id->id)) |
233 | continue; | 252 | continue; |