Commit 1131b938f0757350f569f8ad5bee737cd02b8e58

Authored by Bjorn Helgaas
Committed by Len Brown
1 parent b2972f8750

ACPI: remove acpi_device.flags.hardware_id

Every acpi_device has at least one ID (if there's no _HID or _CID, we
give it a synthetic or default ID).  So there's no longer a need to
check whether an ID exists; we can just use it.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Showing 3 changed files with 15 additions and 28 deletions Side-by-side Diff

... ... @@ -47,9 +47,6 @@
47 47 int count;
48 48 struct acpi_hardware_id *id;
49 49  
50   - if (!acpi_dev->flags.hardware_id)
51   - return -ENODEV;
52   -
53 50 len = snprintf(modalias, size, "acpi:");
54 51 size -= len;
55 52  
56 53  
... ... @@ -203,17 +200,13 @@
203 200 goto end;
204 201 }
205 202  
206   - if (dev->flags.hardware_id) {
207   - result = device_create_file(&dev->dev, &dev_attr_hid);
208   - if (result)
209   - goto end;
210   - }
  203 + result = device_create_file(&dev->dev, &dev_attr_hid);
  204 + if (result)
  205 + goto end;
211 206  
212   - if (dev->flags.hardware_id) {
213   - result = device_create_file(&dev->dev, &dev_attr_modalias);
214   - if (result)
215   - goto end;
216   - }
  207 + result = device_create_file(&dev->dev, &dev_attr_modalias);
  208 + if (result)
  209 + goto end;
217 210  
218 211 /*
219 212 * If device has _EJ0, 'eject' file is created that is used to trigger
... ... @@ -239,11 +232,8 @@
239 232 if (ACPI_SUCCESS(status))
240 233 device_remove_file(&dev->dev, &dev_attr_eject);
241 234  
242   - if (dev->flags.hardware_id)
243   - device_remove_file(&dev->dev, &dev_attr_modalias);
244   -
245   - if (dev->flags.hardware_id)
246   - device_remove_file(&dev->dev, &dev_attr_hid);
  235 + device_remove_file(&dev->dev, &dev_attr_modalias);
  236 + device_remove_file(&dev->dev, &dev_attr_hid);
247 237 if (dev->handle)
248 238 device_remove_file(&dev->dev, &dev_attr_path);
249 239 }
... ... @@ -474,8 +464,9 @@
474 464 * If failed, create one and link it into acpi_bus_id_list
475 465 */
476 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")) {
478   - acpi_device_bus_id->instance_no ++;
  467 + if (!strcmp(acpi_device_bus_id->bus_id,
  468 + acpi_device_hid(device))) {
  469 + acpi_device_bus_id->instance_no++;
479 470 found = 1;
480 471 kfree(new_bus_id);
481 472 break;
... ... @@ -483,7 +474,7 @@
483 474 }
484 475 if (!found) {
485 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 478 acpi_device_bus_id->instance_no = 0;
488 479 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
489 480 }
490 481  
... ... @@ -1103,10 +1094,8 @@
1103 1094 if (!hid && !cid_list && !cid_add)
1104 1095 hid = "device";
1105 1096  
1106   - if (hid) {
  1097 + if (hid)
1107 1098 acpi_add_id(device, hid);
1108   - device->flags.hardware_id = 1;
1109   - }
1110 1099 if (uid) {
1111 1100 device->pnp.unique_id = ACPI_ALLOCATE_ZEROED(strlen (uid) + 1);
1112 1101 if (device->pnp.unique_id) {
drivers/pnp/pnpacpi/core.c
... ... @@ -230,8 +230,7 @@
230 230 struct pnp_dev *pnp = _pnp;
231 231  
232 232 /* true means it matched */
233   - return acpi->flags.hardware_id
234   - && !acpi_get_physical_device(acpi->handle)
  233 + return !acpi_get_physical_device(acpi->handle)
235 234 && compare_pnp_id(pnp->id, acpi_device_hid(acpi));
236 235 }
237 236  
include/acpi/acpi_bus.h
... ... @@ -141,7 +141,6 @@
141 141  
142 142 struct acpi_device_flags {
143 143 u32 dynamic_status:1;
144   - u32 hardware_id:1;
145 144 u32 bus_address:1;
146 145 u32 unique_id:1;
147 146 u32 removable:1;
... ... @@ -152,7 +151,7 @@
152 151 u32 performance_manageable:1;
153 152 u32 wake_capable:1; /* Wakeup(_PRW) supported? */
154 153 u32 force_power_state:1;
155   - u32 reserved:20;
  154 + u32 reserved:21;
156 155 };
157 156  
158 157 /* File System */