diff options
author | Thierry Reding <treding@nvidia.com> | 2014-08-01 14:15:10 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-09-04 14:41:43 -0600 |
commit | 8d38821cbcf51292cd5a23469d03bd38932a3ba9 (patch) | |
tree | a41f35c52ba3826dc4099a8bf24630a410633f62 /include/linux/ioport.h | |
parent | 52addcf9d6669fa439387610bc65c92fa0980cef (diff) |
resources: Add device-managed request/release_resource()
Provide device-managed implementations of the request_resource() and
release_resource() functions. Upon failure to request a resource, the new
devm_request_resource() function will output an error message for
consistent error reporting.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/ioport.h')
-rw-r--r-- | include/linux/ioport.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 142ec544167c..2c5250222278 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -215,6 +215,11 @@ static inline int __deprecated check_region(resource_size_t s, /* Wrappers for managed devices */ struct device; + +extern int devm_request_resource(struct device *dev, struct resource *root, + struct resource *new); +extern void devm_release_resource(struct device *dev, struct resource *new); + #define devm_request_region(dev,start,n,name) \ __devm_request_region(dev, &ioport_resource, (start), (n), (name)) #define devm_request_mem_region(dev,start,n,name) \ |