diff mbox

cpuidle: Remove module_get/put of registered driver

Message ID 1276554817-3259-1-git-send-email-venki@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Venkatesh Pallipadi June 14, 2010, 10:33 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 1994885..c318692 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -275,8 +275,6 @@  static int __cpuidle_register_device(struct cpuidle_device *dev)
 
 	if (!sys_dev)
 		return -EINVAL;
-	if (!try_module_get(cpuidle_driver->owner))
-		return -EINVAL;
 
 	init_completion(&dev->kobj_unregister);
 
@@ -284,10 +282,8 @@  static int __cpuidle_register_device(struct cpuidle_device *dev)
 
 	per_cpu(cpuidle_devices, dev->cpu) = dev;
 	list_add(&dev->device_list, &cpuidle_detected_devices);
-	if ((ret = cpuidle_add_sysfs(sys_dev))) {
-		module_put(cpuidle_driver->owner);
+	if ((ret = cpuidle_add_sysfs(sys_dev)))
 		return ret;
-	}
 
 	dev->registered = 1;
 	return 0;
@@ -341,8 +337,6 @@  void cpuidle_unregister_device(struct cpuidle_device *dev)
 	per_cpu(cpuidle_devices, dev->cpu) = NULL;
 
 	cpuidle_resume_and_unlock();
-
-	module_put(cpuidle_driver->owner);
 }
 
 EXPORT_SYMBOL_GPL(cpuidle_unregister_device);