diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-11-11 01:18:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 17:52:01 -0500 |
commit | 465ae641e4a3e5028aa9c85d3843259aa28a22ce (patch) | |
tree | a8f20c576d03dc40d67ad8b5ee5f9dec4f114a81 /drivers | |
parent | c6dbaef22a2f78700e242915a13218dd780c89ff (diff) |
ACPI: Change ACPI to use dev_archdata instead of firmware_data
Change ACPI to use dev_archdata instead of firmware_data
This patch changes ACPI to use the new dev_archdata on i386, x86_64
and ia64 (is there any other arch using ACPI ?) to store it's
acpi_handle.
It also removes the firmware_data field from struct device as this
was the only user.
Only build-tested on x86
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/glue.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 10f160dc75b1..a2f46d587d55 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -267,9 +267,9 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle) | |||
267 | { | 267 | { |
268 | acpi_status status; | 268 | acpi_status status; |
269 | 269 | ||
270 | if (dev->firmware_data) { | 270 | if (dev->archdata.acpi_handle) { |
271 | printk(KERN_WARNING PREFIX | 271 | printk(KERN_WARNING PREFIX |
272 | "Drivers changed 'firmware_data' for %s\n", dev->bus_id); | 272 | "Drivers changed 'acpi_handle' for %s\n", dev->bus_id); |
273 | return -EINVAL; | 273 | return -EINVAL; |
274 | } | 274 | } |
275 | get_device(dev); | 275 | get_device(dev); |
@@ -278,25 +278,26 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle) | |||
278 | put_device(dev); | 278 | put_device(dev); |
279 | return -EINVAL; | 279 | return -EINVAL; |
280 | } | 280 | } |
281 | dev->firmware_data = handle; | 281 | dev->archdata.acpi_handle = handle; |
282 | 282 | ||
283 | return 0; | 283 | return 0; |
284 | } | 284 | } |
285 | 285 | ||
286 | static int acpi_unbind_one(struct device *dev) | 286 | static int acpi_unbind_one(struct device *dev) |
287 | { | 287 | { |
288 | if (!dev->firmware_data) | 288 | if (!dev->archdata.acpi_handle) |
289 | return 0; | 289 | return 0; |
290 | if (dev == acpi_get_physical_device(dev->firmware_data)) { | 290 | if (dev == acpi_get_physical_device(dev->archdata.acpi_handle)) { |
291 | /* acpi_get_physical_device increase refcnt by one */ | 291 | /* acpi_get_physical_device increase refcnt by one */ |
292 | put_device(dev); | 292 | put_device(dev); |
293 | acpi_detach_data(dev->firmware_data, acpi_glue_data_handler); | 293 | acpi_detach_data(dev->archdata.acpi_handle, |
294 | dev->firmware_data = NULL; | 294 | acpi_glue_data_handler); |
295 | dev->archdata.acpi_handle = NULL; | ||
295 | /* acpi_bind_one increase refcnt by one */ | 296 | /* acpi_bind_one increase refcnt by one */ |
296 | put_device(dev); | 297 | put_device(dev); |
297 | } else { | 298 | } else { |
298 | printk(KERN_ERR PREFIX | 299 | printk(KERN_ERR PREFIX |
299 | "Oops, 'firmware_data' corrupt for %s\n", dev->bus_id); | 300 | "Oops, 'acpi_handle' corrupt for %s\n", dev->bus_id); |
300 | } | 301 | } |
301 | return 0; | 302 | return 0; |
302 | } | 303 | } |
@@ -328,7 +329,8 @@ static int acpi_platform_notify(struct device *dev) | |||
328 | if (!ret) { | 329 | if (!ret) { |
329 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 330 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
330 | 331 | ||
331 | acpi_get_name(dev->firmware_data, ACPI_FULL_PATHNAME, &buffer); | 332 | acpi_get_name(dev->archdata.acpi_handle, |
333 | ACPI_FULL_PATHNAME, &buffer); | ||
332 | DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer); | 334 | DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer); |
333 | kfree(buffer.pointer); | 335 | kfree(buffer.pointer); |
334 | } else | 336 | } else |