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
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.
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