aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/scan.c37
-rw-r--r--drivers/pnp/pnpacpi/core.c3
-rw-r--r--include/acpi/acpi_bus.h3
3 files changed, 15 insertions, 28 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 395ae129aae0..7e031b90c09c 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -47,9 +47,6 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias,
47 int count; 47 int count;
48 struct acpi_hardware_id *id; 48 struct acpi_hardware_id *id;
49 49
50 if (!acpi_dev->flags.hardware_id)
51 return -ENODEV;
52
53 len = snprintf(modalias, size, "acpi:"); 50 len = snprintf(modalias, size, "acpi:");
54 size -= len; 51 size -= len;
55 52
@@ -203,17 +200,13 @@ static int acpi_device_setup_files(struct acpi_device *dev)
203 goto end; 200 goto end;
204 } 201 }
205 202
206 if (dev->flags.hardware_id) { 203 result = device_create_file(&dev->dev, &dev_attr_hid);
207 result = device_create_file(&dev->dev, &dev_attr_hid); 204 if (result)
208 if (result) 205 goto end;
209 goto end;
210 }
211 206
212 if (dev->flags.hardware_id) { 207 result = device_create_file(&dev->dev, &dev_attr_modalias);
213 result = device_create_file(&dev->dev, &dev_attr_modalias); 208 if (result)
214 if (result) 209 goto end;
215 goto end;
216 }
217 210
218 /* 211 /*
219 * If device has _EJ0, 'eject' file is created that is used to trigger 212 * If device has _EJ0, 'eject' file is created that is used to trigger
@@ -239,11 +232,8 @@ static void acpi_device_remove_files(struct acpi_device *dev)
239 if (ACPI_SUCCESS(status)) 232 if (ACPI_SUCCESS(status))
240 device_remove_file(&dev->dev, &dev_attr_eject); 233 device_remove_file(&dev->dev, &dev_attr_eject);
241 234
242 if (dev->flags.hardware_id) 235 device_remove_file(&dev->dev, &dev_attr_modalias);
243 device_remove_file(&dev->dev, &dev_attr_modalias); 236 device_remove_file(&dev->dev, &dev_attr_hid);
244
245 if (dev->flags.hardware_id)
246 device_remove_file(&dev->dev, &dev_attr_hid);
247 if (dev->handle) 237 if (dev->handle)
248 device_remove_file(&dev->dev, &dev_attr_path); 238 device_remove_file(&dev->dev, &dev_attr_path);
249} 239}
@@ -474,8 +464,9 @@ static int acpi_device_register(struct acpi_device *device)
474 * If failed, create one and link it into acpi_bus_id_list 464 * If failed, create one and link it into acpi_bus_id_list
475 */ 465 */
476 list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { 466 list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) {
477 if (!strcmp(acpi_device_bus_id->bus_id, device->flags.hardware_id ? acpi_device_hid(device) : "device")) { 467 if (!strcmp(acpi_device_bus_id->bus_id,
478 acpi_device_bus_id->instance_no ++; 468 acpi_device_hid(device))) {
469 acpi_device_bus_id->instance_no++;
479 found = 1; 470 found = 1;
480 kfree(new_bus_id); 471 kfree(new_bus_id);
481 break; 472 break;
@@ -483,7 +474,7 @@ static int acpi_device_register(struct acpi_device *device)
483 } 474 }
484 if (!found) { 475 if (!found) {
485 acpi_device_bus_id = new_bus_id; 476 acpi_device_bus_id = new_bus_id;
486 strcpy(acpi_device_bus_id->bus_id, device->flags.hardware_id ? acpi_device_hid(device) : "device"); 477 strcpy(acpi_device_bus_id->bus_id, acpi_device_hid(device));
487 acpi_device_bus_id->instance_no = 0; 478 acpi_device_bus_id->instance_no = 0;
488 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); 479 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
489 } 480 }
@@ -1103,10 +1094,8 @@ static void acpi_device_set_id(struct acpi_device *device)
1103 if (!hid && !cid_list && !cid_add) 1094 if (!hid && !cid_list && !cid_add)
1104 hid = "device"; 1095 hid = "device";
1105 1096
1106 if (hid) { 1097 if (hid)
1107 acpi_add_id(device, hid); 1098 acpi_add_id(device, hid);
1108 device->flags.hardware_id = 1;
1109 }
1110 if (uid) { 1099 if (uid) {
1111 device->pnp.unique_id = ACPI_ALLOCATE_ZEROED(strlen (uid) + 1); 1100 device->pnp.unique_id = ACPI_ALLOCATE_ZEROED(strlen (uid) + 1);
1112 if (device->pnp.unique_id) { 1101 if (device->pnp.unique_id) {
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 3a4478f1fc72..83b8b5ac49c9 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -230,8 +230,7 @@ static int __init acpi_pnp_match(struct device *dev, void *_pnp)
230 struct pnp_dev *pnp = _pnp; 230 struct pnp_dev *pnp = _pnp;
231 231
232 /* true means it matched */ 232 /* true means it matched */
233 return acpi->flags.hardware_id 233 return !acpi_get_physical_device(acpi->handle)
234 && !acpi_get_physical_device(acpi->handle)
235 && compare_pnp_id(pnp->id, acpi_device_hid(acpi)); 234 && compare_pnp_id(pnp->id, acpi_device_hid(acpi));
236} 235}
237 236
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 0a970e4ade6f..6599b8cab45a 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -141,7 +141,6 @@ struct acpi_device_status {
141 141
142struct acpi_device_flags { 142struct acpi_device_flags {
143 u32 dynamic_status:1; 143 u32 dynamic_status:1;
144 u32 hardware_id:1;
145 u32 bus_address:1; 144 u32 bus_address:1;
146 u32 unique_id:1; 145 u32 unique_id:1;
147 u32 removable:1; 146 u32 removable:1;
@@ -152,7 +151,7 @@ struct acpi_device_flags {
152 u32 performance_manageable:1; 151 u32 performance_manageable:1;
153 u32 wake_capable:1; /* Wakeup(_PRW) supported? */ 152 u32 wake_capable:1; /* Wakeup(_PRW) supported? */
154 u32 force_power_state:1; 153 u32 force_power_state:1;
155 u32 reserved:20; 154 u32 reserved:21;
156}; 155};
157 156
158/* File System */ 157/* File System */