]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
tegra: Add function to release resources
authorAndrew Chew <achew@nvidia.com>
Wed, 1 Aug 2012 23:52:42 +0000 (16:52 -0700)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 08:27:05 +0000 (01:27 -0700)
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.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Change-Id: I72ffc1e8d3eb7bc0d86896e80f121d2a432abbad
Reviewed-on: http://git-master/r/145343
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Allen Martin <amartin@nvidia.com>
Rebase-Id: Rb1f9c754c85da8bb0c1171e80f597b26f40c426a

drivers/video/tegra/host/bus_client.c
drivers/video/tegra/host/bus_client.h

index c79a22dddad5aad5e5e600dc1173e632422662d7..7033fe8c365efe4147b501a3258e0bcbf0b1e848 100644 (file)
@@ -764,6 +764,18 @@ 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));
+}
+
 /* This is a simple wrapper around request_firmware that takes
  * 'fw_name' and if available applies a SOC relative path prefix to it.
  * The caller is responsible for calling release_firmware later.
index f665e171f24703f0cce44306a3859bb46c693bf5..ff3dd867aab9c54ae161816aa8aa3979716ad727 100644 (file)
@@ -41,5 +41,6 @@ const struct firmware *
 nvhost_client_request_firmware(struct nvhost_device *dev, const char *fw_name);
 
 int nvhost_client_device_get_resources(struct nvhost_device *dev);
+void nvhost_client_device_put_resources(struct nvhost_device *dev);
 
 #endif