aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resource.c
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2015-02-05 00:44:43 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-02-05 09:09:25 -0500
commit90e97820619dc912b52cc9d103272819d8b51259 (patch)
tree20e8c3000c47b0dea7eca79ef7c49db916606d65 /drivers/acpi/resource.c
parent62d1141ff34e35de496ba06491c8e854b23b3f3e (diff)
resources: Move struct resource_list_entry from ACPI into resource core
Currently ACPI, PCI and pnp all implement the same resource list management with different data structure. We need to transfer from one data structure into another when passing resources from one subsystem into another subsystem. So move struct resource_list_entry from ACPI into resource core and rename it as resource_entry, then it could be reused by different subystems and avoid the data structure conversion. Introduce dedicated header file resource_ext.h instead of embedding it into ioport.h to avoid header file inclusion order issues. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/resource.c')
-rw-r--r--drivers/acpi/resource.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 3ea0d17eb951..4752b9939987 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -444,12 +444,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_resource_interrupt);
444 */ 444 */
445void acpi_dev_free_resource_list(struct list_head *list) 445void acpi_dev_free_resource_list(struct list_head *list)
446{ 446{
447 struct resource_list_entry *rentry, *re; 447 resource_list_free(list);
448
449 list_for_each_entry_safe(rentry, re, list, node) {
450 list_del(&rentry->node);
451 kfree(rentry);
452 }
453} 448}
454EXPORT_SYMBOL_GPL(acpi_dev_free_resource_list); 449EXPORT_SYMBOL_GPL(acpi_dev_free_resource_list);
455 450
@@ -464,16 +459,16 @@ struct res_proc_context {
464static acpi_status acpi_dev_new_resource_entry(struct resource_win *win, 459static acpi_status acpi_dev_new_resource_entry(struct resource_win *win,
465 struct res_proc_context *c) 460 struct res_proc_context *c)
466{ 461{
467 struct resource_list_entry *rentry; 462 struct resource_entry *rentry;
468 463
469 rentry = kmalloc(sizeof(*rentry), GFP_KERNEL); 464 rentry = resource_list_create_entry(NULL, 0);
470 if (!rentry) { 465 if (!rentry) {
471 c->error = -ENOMEM; 466 c->error = -ENOMEM;
472 return AE_NO_MEMORY; 467 return AE_NO_MEMORY;
473 } 468 }
474 rentry->res = win->res; 469 *rentry->res = win->res;
475 rentry->offset = win->offset; 470 rentry->offset = win->offset;
476 list_add_tail(&rentry->node, c->list); 471 resource_list_add_tail(rentry, c->list);
477 c->count++; 472 c->count++;
478 return AE_OK; 473 return AE_OK;
479} 474}
@@ -534,7 +529,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares,
534 * returned as the final error code. 529 * returned as the final error code.
535 * 530 *
536 * The resultant struct resource objects are put on the list pointed to by 531 * The resultant struct resource objects are put on the list pointed to by
537 * @list, that must be empty initially, as members of struct resource_list_entry 532 * @list, that must be empty initially, as members of struct resource_entry
538 * objects. Callers of this routine should use %acpi_dev_free_resource_list() to 533 * objects. Callers of this routine should use %acpi_dev_free_resource_list() to
539 * free that list. 534 * free that list.
540 * 535 *