ChangeSet 1.1063.29.2, 2003/09/24 14:36:39-07:00, t-kouchi@mvf.biglobe.ne.jp [PATCH] PCI Hotplug: acpiphp cleanup patch for 2.4.23-pre4 This is a cleanup patch of the acpiphp driver. As we have the latest ACPI driver in the tree, we no longer need compatibility #ifdefs. This patch is generated against the driver with the patch I posted the other day ('address' file addition), but can be applied independently with some offsets. drivers/hotplug/acpiphp.h | 56 ----------------------------------------- drivers/hotplug/acpiphp_glue.c | 36 -------------------------- 2 files changed, 92 deletions(-) diff -Nru a/drivers/hotplug/acpiphp.h b/drivers/hotplug/acpiphp.h --- a/drivers/hotplug/acpiphp.h Wed Apr 28 15:20:54 2004 +++ b/drivers/hotplug/acpiphp.h Wed Apr 28 15:20:54 2004 @@ -36,63 +36,7 @@ #include #include "pci_hotplug.h" -#if ACPI_CA_VERSION < 0x20020201 -/* until we get a new version of the ACPI driver for both ia32 and ia64 ... */ -#define acpi_util_eval_error(h,p,s) - -static acpi_status -acpi_evaluate_integer ( - acpi_handle handle, - acpi_string pathname, - acpi_object_list *arguments, - unsigned long *data) -{ - acpi_status status = AE_OK; - acpi_object element; - acpi_buffer buffer = {sizeof(acpi_object), &element}; - - if (!data) - return AE_BAD_PARAMETER; - - status = acpi_evaluate_object(handle, pathname, arguments, &buffer); - if (ACPI_FAILURE(status)) { - acpi_util_eval_error(handle, pathname, status); - return status; - } - - if (element.type != ACPI_TYPE_INTEGER) { - acpi_util_eval_error(handle, pathname, AE_BAD_DATA); - return AE_BAD_DATA; - } - - *data = element.integer.value; - - return AE_OK; -} -#else /* ACPI_CA_VERSION < 0x20020201 */ #include -#endif - -/* compatibility stuff for ACPI CA */ -#ifndef ACPI_MEMORY_RANGE -#define ACPI_MEMORY_RANGE MEMORY_RANGE -#endif - -#ifndef ACPI_IO_RANGE -#define ACPI_IO_RANGE IO_RANGE -#endif - -#ifndef ACPI_BUS_NUMBER_RANGE -#define ACPI_BUS_NUMBER_RANGE BUS_NUMBER_RANGE -#endif - -#ifndef ACPI_PREFETCHABLE_MEMORY -#define ACPI_PREFETCHABLE_MEMORY PREFETCHABLE_MEMORY -#endif - -#ifndef ACPI_PRODUCER -#define ACPI_PRODUCER PRODUCER -#endif #define dbg(format, arg...) \ do { \ diff -Nru a/drivers/hotplug/acpiphp_glue.c b/drivers/hotplug/acpiphp_glue.c --- a/drivers/hotplug/acpiphp_glue.c Wed Apr 28 15:20:54 2004 +++ b/drivers/hotplug/acpiphp_glue.c Wed Apr 28 15:20:54 2004 @@ -389,12 +389,8 @@ static void decode_hpp(struct acpiphp_bridge *bridge) { acpi_status status; -#if ACPI_CA_VERSION < 0x20020201 - acpi_buffer buffer; -#else struct acpi_buffer buffer = { .length = ACPI_ALLOCATE_BUFFER, .pointer = NULL}; -#endif union acpi_object *package; int i; @@ -404,21 +400,7 @@ bridge->hpp.enable_SERR = 0; bridge->hpp.enable_PERR = 0; -#if ACPI_CA_VERSION < 0x20020201 - buffer.length = 0; - buffer.pointer = NULL; - - status = acpi_evaluate_object(bridge->handle, "_HPP", NULL, &buffer); - - if (status == AE_BUFFER_OVERFLOW) { - buffer.pointer = kmalloc(buffer.length, GFP_KERNEL); - if (!buffer.pointer) - return; - status = acpi_evaluate_object(bridge->handle, "_HPP", NULL, &buffer); - } -#else status = acpi_evaluate_object(bridge->handle, "_HPP", NULL, &buffer); -#endif if (ACPI_FAILURE(status)) { dbg("_HPP evaluation failed\n"); @@ -494,12 +476,8 @@ static void add_host_bridge (acpi_handle *handle, int seg, int bus) { acpi_status status; -#if ACPI_CA_VERSION < 0x20020201 - acpi_buffer buffer; -#else struct acpi_buffer buffer = { .length = ACPI_ALLOCATE_BUFFER, .pointer = NULL}; -#endif struct acpiphp_bridge *bridge; bridge = kmalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); @@ -522,21 +500,7 @@ /* decode resources */ -#if ACPI_CA_VERSION < 0x20020201 - buffer.length = 0; - buffer.pointer = NULL; - - status = acpi_get_current_resources(handle, &buffer); - - if (status == AE_BUFFER_OVERFLOW) { - buffer.pointer = kmalloc(buffer.length, GFP_KERNEL); - if (!buffer.pointer) - return; - status = acpi_get_current_resources(handle, &buffer); - } -#else status = acpi_get_current_resources(handle, &buffer); -#endif if (ACPI_FAILURE(status)) { err("failed to decode bridge resources\n");