resource: Add remove_resource interface
commitff3cc952d3f009e6c376cc40651b87187ce364a6
authorToshi Kani <toshi.kani@hpe.com>
Wed, 9 Mar 2016 19:47:04 +0000 (9 12:47 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 9 Mar 2016 19:07:20 +0000 (9 11:07 -0800)
treec0b685a62ea8908bfdab98dc372bfe75fd0f291e
parent4e0d8f7eff3fbfa3e3ac5782669c078f590dc9e2
resource: Add remove_resource interface

insert_resource() and insert_resource_conflict() are called
by resource producers to insert a new resource.  When there
is any conflict, they move conflicting resources down to the
children of the new resource.  There is no destructor of these
interfaces, however.

Add remove_resource(), which removes a resource previously
inserted by insert_resource() or insert_resource_conflict(),
and moves the children up to where they were before.

__release_resource() is changed to have @release_child, so
that this function can be used for remove_resource() as well.

Also add comments to clarify that these functions are intended
for producers of resources to avoid any confusion with
request/release_resource() for consumers.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
include/linux/ioport.h
kernel/resource.c