diff options
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 34049b0b4c73..747826d99059 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -239,8 +239,6 @@ static char *__init pnpacpi_get_id(struct acpi_device *device) | |||
239 | 239 | ||
240 | static int __init pnpacpi_add_device(struct acpi_device *device) | 240 | static int __init pnpacpi_add_device(struct acpi_device *device) |
241 | { | 241 | { |
242 | acpi_handle temp = NULL; | ||
243 | acpi_status status; | ||
244 | struct pnp_dev *dev; | 242 | struct pnp_dev *dev; |
245 | char *pnpid; | 243 | char *pnpid; |
246 | struct acpi_hardware_id *id; | 244 | struct acpi_hardware_id *id; |
@@ -253,8 +251,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
253 | * If a PnPacpi device is not present , the device | 251 | * If a PnPacpi device is not present , the device |
254 | * driver should not be loaded. | 252 | * driver should not be loaded. |
255 | */ | 253 | */ |
256 | status = acpi_get_handle(device->handle, "_CRS", &temp); | 254 | if (!acpi_has_method(device->handle, "_CRS")) |
257 | if (ACPI_FAILURE(status)) | ||
258 | return 0; | 255 | return 0; |
259 | 256 | ||
260 | pnpid = pnpacpi_get_id(device); | 257 | pnpid = pnpacpi_get_id(device); |
@@ -271,16 +268,14 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
271 | dev->data = device; | 268 | dev->data = device; |
272 | /* .enabled means the device can decode the resources */ | 269 | /* .enabled means the device can decode the resources */ |
273 | dev->active = device->status.enabled; | 270 | dev->active = device->status.enabled; |
274 | status = acpi_get_handle(device->handle, "_SRS", &temp); | 271 | if (acpi_has_method(device->handle, "_SRS")) |
275 | if (ACPI_SUCCESS(status)) | ||
276 | dev->capabilities |= PNP_CONFIGURABLE; | 272 | dev->capabilities |= PNP_CONFIGURABLE; |
277 | dev->capabilities |= PNP_READ; | 273 | dev->capabilities |= PNP_READ; |
278 | if (device->flags.dynamic_status && (dev->capabilities & PNP_CONFIGURABLE)) | 274 | if (device->flags.dynamic_status && (dev->capabilities & PNP_CONFIGURABLE)) |
279 | dev->capabilities |= PNP_WRITE; | 275 | dev->capabilities |= PNP_WRITE; |
280 | if (device->flags.removable) | 276 | if (device->flags.removable) |
281 | dev->capabilities |= PNP_REMOVABLE; | 277 | dev->capabilities |= PNP_REMOVABLE; |
282 | status = acpi_get_handle(device->handle, "_DIS", &temp); | 278 | if (acpi_has_method(device->handle, "_DIS")) |
283 | if (ACPI_SUCCESS(status)) | ||
284 | dev->capabilities |= PNP_DISABLE; | 279 | dev->capabilities |= PNP_DISABLE; |
285 | 280 | ||
286 | if (strlen(acpi_device_name(device))) | 281 | if (strlen(acpi_device_name(device))) |