Commit 3a83f992490f8235661b768e53bd5f14915420ac

Authored by Rafael J. Wysocki
1 parent 7b1998116b

ACPI: Eliminate the DEVICE_ACPI_HANDLE() macro

Since DEVICE_ACPI_HANDLE() is now literally identical to
ACPI_HANDLE(), replace it with the latter everywhere and drop its
definition from include/acpi.h.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 21 changed files with 42 additions and 44 deletions Side-by-side Diff

drivers/acpi/device_pm.c
... ... @@ -544,7 +544,7 @@
544 544 */
545 545 int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
546 546 {
547   - acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
  547 + acpi_handle handle = ACPI_HANDLE(dev);
548 548 struct acpi_device *adev;
549 549 int ret, d_min, d_max;
550 550  
... ... @@ -652,7 +652,7 @@
652 652 if (!device_run_wake(phys_dev))
653 653 return -EINVAL;
654 654  
655   - handle = DEVICE_ACPI_HANDLE(phys_dev);
  655 + handle = ACPI_HANDLE(phys_dev);
656 656 if (!handle || acpi_bus_get_device(handle, &adev)) {
657 657 dev_dbg(phys_dev, "ACPI handle without context in %s!\n",
658 658 __func__);
... ... @@ -696,7 +696,7 @@
696 696 if (!device_can_wakeup(dev))
697 697 return -EINVAL;
698 698  
699   - handle = DEVICE_ACPI_HANDLE(dev);
  699 + handle = ACPI_HANDLE(dev);
700 700 if (!handle || acpi_bus_get_device(handle, &adev)) {
701 701 dev_dbg(dev, "ACPI handle without context in %s!\n", __func__);
702 702 return -ENODEV;
... ... @@ -718,7 +718,7 @@
718 718 */
719 719 struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
720 720 {
721   - acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
  721 + acpi_handle handle = ACPI_HANDLE(dev);
722 722 struct acpi_device *adev;
723 723  
724 724 return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
drivers/gpu/drm/i915/intel_acpi.c
... ... @@ -196,7 +196,7 @@
196 196 acpi_handle dhandle;
197 197 int ret;
198 198  
199   - dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
  199 + dhandle = ACPI_HANDLE(&pdev->dev);
200 200 if (!dhandle)
201 201 return false;
202 202  
drivers/gpu/drm/i915/intel_opregion.c
... ... @@ -289,7 +289,7 @@
289 289 u32 temp;
290 290 int i = 0;
291 291  
292   - handle = DEVICE_ACPI_HANDLE(&dev->pdev->dev);
  292 + handle = ACPI_HANDLE(&dev->pdev->dev);
293 293 if (!handle || acpi_bus_get_device(handle, &acpi_dev))
294 294 return;
295 295  
drivers/gpu/drm/nouveau/core/subdev/mxm/base.c
... ... @@ -116,7 +116,7 @@
116 116 acpi_handle handle;
117 117 int ret;
118 118  
119   - handle = DEVICE_ACPI_HANDLE(&device->pdev->dev);
  119 + handle = ACPI_HANDLE(&device->pdev->dev);
120 120 if (!handle)
121 121 return false;
122 122  
drivers/gpu/drm/nouveau/nouveau_acpi.c
... ... @@ -256,7 +256,7 @@
256 256 acpi_handle dhandle;
257 257 int retval = 0;
258 258  
259   - dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
  259 + dhandle = ACPI_HANDLE(&pdev->dev);
260 260 if (!dhandle)
261 261 return false;
262 262  
... ... @@ -404,7 +404,7 @@
404 404 if (!nouveau_dsm_priv.dsm_detected && !nouveau_dsm_priv.optimus_detected)
405 405 return false;
406 406  
407   - dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
  407 + dhandle = ACPI_HANDLE(&pdev->dev);
408 408 if (!dhandle)
409 409 return false;
410 410  
... ... @@ -438,7 +438,7 @@
438 438 return NULL;
439 439 }
440 440  
441   - handle = DEVICE_ACPI_HANDLE(&dev->pdev->dev);
  441 + handle = ACPI_HANDLE(&dev->pdev->dev);
442 442 if (!handle)
443 443 return NULL;
444 444  
drivers/gpu/drm/radeon/radeon_acpi.c
... ... @@ -369,7 +369,7 @@
369 369 return NOTIFY_DONE;
370 370  
371 371 /* Check pending SBIOS requests */
372   - handle = DEVICE_ACPI_HANDLE(&rdev->pdev->dev);
  372 + handle = ACPI_HANDLE(&rdev->pdev->dev);
373 373 count = radeon_atif_get_sbios_requests(handle, &req);
374 374  
375 375 if (count <= 0)
... ... @@ -556,7 +556,7 @@
556 556 struct radeon_atcs *atcs = &rdev->atcs;
557 557  
558 558 /* Get the device handle */
559   - handle = DEVICE_ACPI_HANDLE(&rdev->pdev->dev);
  559 + handle = ACPI_HANDLE(&rdev->pdev->dev);
560 560 if (!handle)
561 561 return -EINVAL;
562 562  
... ... @@ -596,7 +596,7 @@
596 596 u32 retry = 3;
597 597  
598 598 /* Get the device handle */
599   - handle = DEVICE_ACPI_HANDLE(&rdev->pdev->dev);
  599 + handle = ACPI_HANDLE(&rdev->pdev->dev);
600 600 if (!handle)
601 601 return -EINVAL;
602 602  
... ... @@ -699,7 +699,7 @@
699 699 int ret;
700 700  
701 701 /* Get the device handle */
702   - handle = DEVICE_ACPI_HANDLE(&rdev->pdev->dev);
  702 + handle = ACPI_HANDLE(&rdev->pdev->dev);
703 703  
704 704 /* No need to proceed if we're sure that ATIF is not supported */
705 705 if (!ASIC_IS_AVIVO(rdev) || !rdev->bios || !handle)
drivers/gpu/drm/radeon/radeon_atpx_handler.c
... ... @@ -442,7 +442,7 @@
442 442 acpi_handle dhandle, atpx_handle;
443 443 acpi_status status;
444 444  
445   - dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
  445 + dhandle = ACPI_HANDLE(&pdev->dev);
446 446 if (!dhandle)
447 447 return false;
448 448  
... ... @@ -488,7 +488,7 @@
488 488 */
489 489 static int radeon_atpx_get_client_id(struct pci_dev *pdev)
490 490 {
491   - if (radeon_atpx_priv.dhandle == DEVICE_ACPI_HANDLE(&pdev->dev))
  491 + if (radeon_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev))
492 492 return VGA_SWITCHEROO_IGD;
493 493 else
494 494 return VGA_SWITCHEROO_DIS;
drivers/gpu/drm/radeon/radeon_bios.c
... ... @@ -185,7 +185,7 @@
185 185 return false;
186 186  
187 187 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
188   - dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
  188 + dhandle = ACPI_HANDLE(&pdev->dev);
189 189 if (!dhandle)
190 190 continue;
191 191  
drivers/ide/ide-acpi.c
... ... @@ -127,7 +127,7 @@
127 127  
128 128 DEBPRINT("ENTER: pci %02x:%02x.%01x\n", bus, devnum, func);
129 129  
130   - dev_handle = DEVICE_ACPI_HANDLE(dev);
  130 + dev_handle = ACPI_HANDLE(dev);
131 131 if (!dev_handle) {
132 132 DEBPRINT("no acpi handle for device\n");
133 133 goto err;
drivers/pci/hotplug/acpi_pcihp.c
... ... @@ -367,7 +367,7 @@
367 367 string = (struct acpi_buffer){ ACPI_ALLOCATE_BUFFER, NULL };
368 368 }
369 369  
370   - handle = DEVICE_ACPI_HANDLE(&pdev->dev);
  370 + handle = ACPI_HANDLE(&pdev->dev);
371 371 if (!handle) {
372 372 /*
373 373 * This hotplug controller was not listed in the ACPI name
drivers/pci/hotplug/pciehp_acpi.c
... ... @@ -54,7 +54,7 @@
54 54 {
55 55 if (slot_detection_mode != PCIEHP_DETECT_ACPI)
56 56 return 0;
57   - if (acpi_pci_detect_ejectable(DEVICE_ACPI_HANDLE(&dev->dev)))
  57 + if (acpi_pci_detect_ejectable(ACPI_HANDLE(&dev->dev)))
58 58 return 0;
59 59 return -ENODEV;
60 60 }
... ... @@ -96,7 +96,7 @@
96 96 dup_slot_id++;
97 97 }
98 98 list_add_tail(&slot->list, &dummy_slots);
99   - handle = DEVICE_ACPI_HANDLE(&pdev->dev);
  99 + handle = ACPI_HANDLE(&pdev->dev);
100 100 if (!acpi_slot_detected && acpi_pci_detect_ejectable(handle))
101 101 acpi_slot_detected = 1;
102 102 return -ENODEV; /* dummy driver always returns error */
drivers/pci/ioapic.c
... ... @@ -37,7 +37,7 @@
37 37 char *type;
38 38 struct resource *res;
39 39  
40   - handle = DEVICE_ACPI_HANDLE(&dev->dev);
  40 + handle = ACPI_HANDLE(&dev->dev);
41 41 if (!handle)
42 42 return -EINVAL;
43 43  
drivers/pci/pci-acpi.c
... ... @@ -173,14 +173,14 @@
173 173  
174 174 static bool acpi_pci_power_manageable(struct pci_dev *dev)
175 175 {
176   - acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
  176 + acpi_handle handle = ACPI_HANDLE(&dev->dev);
177 177  
178 178 return handle ? acpi_bus_power_manageable(handle) : false;
179 179 }
180 180  
181 181 static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
182 182 {
183   - acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
  183 + acpi_handle handle = ACPI_HANDLE(&dev->dev);
184 184 static const u8 state_conv[] = {
185 185 [PCI_D0] = ACPI_STATE_D0,
186 186 [PCI_D1] = ACPI_STATE_D1,
... ... @@ -217,7 +217,7 @@
217 217  
218 218 static bool acpi_pci_can_wakeup(struct pci_dev *dev)
219 219 {
220   - acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
  220 + acpi_handle handle = ACPI_HANDLE(&dev->dev);
221 221  
222 222 return handle ? acpi_bus_can_wakeup(handle) : false;
223 223 }
drivers/pci/pci-label.c
... ... @@ -263,7 +263,7 @@
263 263 acpi_handle handle;
264 264 struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};
265 265  
266   - handle = DEVICE_ACPI_HANDLE(dev);
  266 + handle = ACPI_HANDLE(dev);
267 267  
268 268 if (!handle)
269 269 return FALSE;
... ... @@ -295,7 +295,7 @@
295 295 acpi_handle handle;
296 296 int length;
297 297  
298   - handle = DEVICE_ACPI_HANDLE(dev);
  298 + handle = ACPI_HANDLE(dev);
299 299  
300 300 if (!handle)
301 301 return -1;
... ... @@ -316,7 +316,7 @@
316 316 acpi_handle handle;
317 317 int length;
318 318  
319   - handle = DEVICE_ACPI_HANDLE(dev);
  319 + handle = ACPI_HANDLE(dev);
320 320  
321 321 if (!handle)
322 322 return -1;
drivers/platform/x86/apple-gmux.c
... ... @@ -519,7 +519,7 @@
519 519  
520 520 gmux_data->power_state = VGA_SWITCHEROO_ON;
521 521  
522   - gmux_data->dhandle = DEVICE_ACPI_HANDLE(&pnp->dev);
  522 + gmux_data->dhandle = ACPI_HANDLE(&pnp->dev);
523 523 if (!gmux_data->dhandle) {
524 524 pr_err("Cannot find acpi handle for pnp device %s\n",
525 525 dev_name(&pnp->dev));
drivers/pnp/pnpacpi/core.c
... ... @@ -89,7 +89,7 @@
89 89  
90 90 pnp_dbg(&dev->dev, "set resources\n");
91 91  
92   - handle = DEVICE_ACPI_HANDLE(&dev->dev);
  92 + handle = ACPI_HANDLE(&dev->dev);
93 93 if (!handle || acpi_bus_get_device(handle, &acpi_dev)) {
94 94 dev_dbg(&dev->dev, "ACPI device not found in %s!\n", __func__);
95 95 return -ENODEV;
... ... @@ -122,7 +122,7 @@
122 122  
123 123 dev_dbg(&dev->dev, "disable resources\n");
124 124  
125   - handle = DEVICE_ACPI_HANDLE(&dev->dev);
  125 + handle = ACPI_HANDLE(&dev->dev);
126 126 if (!handle || acpi_bus_get_device(handle, &acpi_dev)) {
127 127 dev_dbg(&dev->dev, "ACPI device not found in %s!\n", __func__);
128 128 return 0;
... ... @@ -144,7 +144,7 @@
144 144 struct acpi_device *acpi_dev;
145 145 acpi_handle handle;
146 146  
147   - handle = DEVICE_ACPI_HANDLE(&dev->dev);
  147 + handle = ACPI_HANDLE(&dev->dev);
148 148 if (!handle || acpi_bus_get_device(handle, &acpi_dev)) {
149 149 dev_dbg(&dev->dev, "ACPI device not found in %s!\n", __func__);
150 150 return false;
... ... @@ -159,7 +159,7 @@
159 159 acpi_handle handle;
160 160 int error = 0;
161 161  
162   - handle = DEVICE_ACPI_HANDLE(&dev->dev);
  162 + handle = ACPI_HANDLE(&dev->dev);
163 163 if (!handle || acpi_bus_get_device(handle, &acpi_dev)) {
164 164 dev_dbg(&dev->dev, "ACPI device not found in %s!\n", __func__);
165 165 return 0;
... ... @@ -194,7 +194,7 @@
194 194 static int pnpacpi_resume(struct pnp_dev *dev)
195 195 {
196 196 struct acpi_device *acpi_dev;
197   - acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
  197 + acpi_handle handle = ACPI_HANDLE(&dev->dev);
198 198 int error = 0;
199 199  
200 200 if (!handle || acpi_bus_get_device(handle, &acpi_dev)) {
drivers/usb/core/hub.c
... ... @@ -5501,7 +5501,7 @@
5501 5501 if (!hub)
5502 5502 return NULL;
5503 5503  
5504   - return DEVICE_ACPI_HANDLE(&hub->ports[port1 - 1]->dev);
  5504 + return ACPI_HANDLE(&hub->ports[port1 - 1]->dev);
5505 5505 }
5506 5506 #endif
drivers/usb/core/usb-acpi.c
... ... @@ -173,7 +173,7 @@
173 173 }
174 174  
175 175 /* root hub's parent is the usb hcd. */
176   - parent_handle = DEVICE_ACPI_HANDLE(dev->parent);
  176 + parent_handle = ACPI_HANDLE(dev->parent);
177 177 *handle = acpi_get_child(parent_handle, udev->portnum);
178 178 if (!*handle)
179 179 return -ENODEV;
... ... @@ -194,7 +194,7 @@
194 194  
195 195 raw_port_num = usb_hcd_find_raw_port_number(hcd,
196 196 port_num);
197   - *handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev),
  197 + *handle = acpi_get_child(ACPI_HANDLE(&udev->dev),
198 198 raw_port_num);
199 199 if (!*handle)
200 200 return -ENODEV;
... ... @@ -58,12 +58,12 @@
58 58 add.flags = XEN_PCI_DEV_EXTFN;
59 59  
60 60 #ifdef CONFIG_ACPI
61   - handle = DEVICE_ACPI_HANDLE(&pci_dev->dev);
  61 + handle = ACPI_HANDLE(&pci_dev->dev);
62 62 if (!handle && pci_dev->bus->bridge)
63   - handle = DEVICE_ACPI_HANDLE(pci_dev->bus->bridge);
  63 + handle = ACPI_HANDLE(pci_dev->bus->bridge);
64 64 #ifdef CONFIG_PCI_IOV
65 65 if (!handle && pci_dev->is_virtfn)
66   - handle = DEVICE_ACPI_HANDLE(physfn->bus->bridge);
  66 + handle = ACPI_HANDLE(physfn->bus->bridge);
67 67 #endif
68 68 if (handle) {
69 69 acpi_status status;
include/linux/acpi.h
... ... @@ -482,8 +482,6 @@
482 482  
483 483 #endif /* !CONFIG_ACPI */
484 484  
485   -#define DEVICE_ACPI_HANDLE(dev) ACPI_HANDLE(dev)
486   -
487 485 #ifdef CONFIG_ACPI
488 486 void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
489 487 u32 pm1a_ctrl, u32 pm1b_ctrl));
include/linux/pci-acpi.h
... ... @@ -27,7 +27,7 @@
27 27 while (!pci_is_root_bus(pbus))
28 28 pbus = pbus->parent;
29 29  
30   - return DEVICE_ACPI_HANDLE(pbus->bridge);
  30 + return ACPI_HANDLE(pbus->bridge);
31 31 }
32 32  
33 33 static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
... ... @@ -39,7 +39,7 @@
39 39 else
40 40 dev = &pbus->self->dev;
41 41  
42   - return DEVICE_ACPI_HANDLE(dev);
  42 + return ACPI_HANDLE(dev);
43 43 }
44 44  
45 45 void acpi_pci_add_bus(struct pci_bus *bus);