diff options
author | Andrew Chew <achew@nvidia.com> | 2012-08-01 16:52:42 -0700 |
---|---|---|
committer | Winnie Hsu <whsu@nvidia.com> | 2012-12-17 11:31:22 -0800 |
commit | 681999b928434ecb46d379e2381adb31b83e5437 (patch) | |
tree | f02c1cc51e9ac328acc7e1fd825f51c505659bc1 /drivers | |
parent | 62c2aed60372c97eebda02e8833c15b418a16fb0 (diff) |
tegra: Add function to release resources
Add a companion function to nvhost_client_device_get_resources()
called nvhost_client_device_put_resources() that does the opposite
thing. This is useful for any nvhost clients that need to be loaded
as modules, since the driver removal path will be exercised in that
case.
Change-Id: Ib5cec6fce7b05c780b135b03fcd88e068f772244
Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/169833
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/host/bus_client.c | 12 | ||||
-rw-r--r-- | drivers/video/tegra/host/bus_client.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c index aaa038221971..4614689ec37c 100644 --- a/drivers/video/tegra/host/bus_client.c +++ b/drivers/video/tegra/host/bus_client.c @@ -658,3 +658,15 @@ fail: return -ENXIO; } + +void nvhost_client_device_put_resources(struct nvhost_device *dev) +{ + struct resource *r; + + r = nvhost_get_resource(dev, IORESOURCE_MEM, 0); + BUG_ON(!r); + + iounmap(dev->aperture); + + release_mem_region(r->start, resource_size(r)); +} diff --git a/drivers/video/tegra/host/bus_client.h b/drivers/video/tegra/host/bus_client.h index e95ea0bc3401..8c7bdc9faefe 100644 --- a/drivers/video/tegra/host/bus_client.h +++ b/drivers/video/tegra/host/bus_client.h @@ -37,5 +37,6 @@ int nvhost_client_device_init(struct nvhost_device *dev); int nvhost_client_device_suspend(struct nvhost_device *dev); int nvhost_client_device_get_resources(struct nvhost_device *dev); +void nvhost_client_device_put_resources(struct nvhost_device *dev); #endif |