We need to remove those power related sysfs interface when deinit a
module otherwise reinit the module will fail due to existing sysfs
interface.
Bug
1249358
Change-Id: Ic218244534db0f969ddebe92dff2e069a70468cd
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/226474
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Allen Martin <amartin@nvidia.com>
void nvhost_module_deinit(struct platform_device *dev)
{
int i;
+ struct kobj_attribute *attr = NULL;
struct nvhost_device_data *pdata = platform_get_drvdata(dev);
nvhost_module_suspend(dev);
for (i = 0; i < pdata->num_clks; i++)
clk_put(pdata->clk[i]);
+
+ if (pdata->power_kobj) {
+ for (i = 0; i < NVHOST_POWER_SYSFS_ATTRIB_MAX; i++) {
+ attr = &pdata->power_attrib->power_attr[i];
+ sysfs_remove_file(pdata->power_kobj, &attr->attr);
+ }
+
+ kobject_put(pdata->power_kobj);
+ }
+
}
/* common runtime pm and power domain APIs */