aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/glue.c')
-rw-r--r--drivers/acpi/glue.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index ba8fe83c6298..4ac2f18e0da2 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -271,9 +271,9 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
271{ 271{
272 acpi_status status; 272 acpi_status status;
273 273
274 if (dev->firmware_data) { 274 if (dev->archdata.acpi_handle) {
275 printk(KERN_WARNING PREFIX 275 printk(KERN_WARNING PREFIX
276 "Drivers changed 'firmware_data' for %s\n", dev->bus_id); 276 "Drivers changed 'acpi_handle' for %s\n", dev->bus_id);
277 return -EINVAL; 277 return -EINVAL;
278 } 278 }
279 get_device(dev); 279 get_device(dev);
@@ -282,25 +282,26 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
282 put_device(dev); 282 put_device(dev);
283 return -EINVAL; 283 return -EINVAL;
284 } 284 }
285 dev->firmware_data = handle; 285 dev->archdata.acpi_handle = handle;
286 286
287 return 0; 287 return 0;
288} 288}
289 289
290static int acpi_unbind_one(struct device *dev) 290static int acpi_unbind_one(struct device *dev)
291{ 291{
292 if (!dev->firmware_data) 292 if (!dev->archdata.acpi_handle)
293 return 0; 293 return 0;
294 if (dev == acpi_get_physical_device(dev->firmware_data)) { 294 if (dev == acpi_get_physical_device(dev->archdata.acpi_handle)) {
295 /* acpi_get_physical_device increase refcnt by one */ 295 /* acpi_get_physical_device increase refcnt by one */
296 put_device(dev); 296 put_device(dev);
297 acpi_detach_data(dev->firmware_data, acpi_glue_data_handler); 297 acpi_detach_data(dev->archdata.acpi_handle,
298 dev->firmware_data = NULL; 298 acpi_glue_data_handler);
299 dev->archdata.acpi_handle = NULL;
299 /* acpi_bind_one increase refcnt by one */ 300 /* acpi_bind_one increase refcnt by one */
300 put_device(dev); 301 put_device(dev);
301 } else { 302 } else {
302 printk(KERN_ERR PREFIX 303 printk(KERN_ERR PREFIX
303 "Oops, 'firmware_data' corrupt for %s\n", dev->bus_id); 304 "Oops, 'acpi_handle' corrupt for %s\n", dev->bus_id);
304 } 305 }
305 return 0; 306 return 0;
306} 307}
@@ -332,7 +333,8 @@ static int acpi_platform_notify(struct device *dev)
332 if (!ret) { 333 if (!ret) {
333 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 334 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
334 335
335 acpi_get_name(dev->firmware_data, ACPI_FULL_PATHNAME, &buffer); 336 acpi_get_name(dev->archdata.acpi_handle,
337 ACPI_FULL_PATHNAME, &buffer);
336 DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer); 338 DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer);
337 kfree(buffer.pointer); 339 kfree(buffer.pointer);
338 } else 340 } else