]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/devfreq/governor_userspace.c
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / drivers / devfreq / governor_userspace.c
index 35de6e83c1febedd99f8c155e374b5d4f8bb5202..176976068bcd1552d0a625ea47ebdf72812b4c6b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/devfreq/governor_simpleondemand.c
+ *  linux/drivers/devfreq/governor_userspace.c
  *
  *  Copyright (C) 2011 Samsung Electronics
  *     MyungJoo Ham <myungjoo.ham@samsung.com>
@@ -50,7 +50,6 @@ static ssize_t store_freq(struct device *dev, struct device_attribute *attr,
        unsigned long wanted;
        int err = 0;
 
-
        mutex_lock(&devfreq->lock);
        data = devfreq->data;
 
@@ -112,7 +111,13 @@ out:
 
 static void userspace_exit(struct devfreq *devfreq)
 {
-       sysfs_remove_group(&devfreq->dev.kobj, &dev_attr_group);
+       /*
+        * Remove the sysfs entry, unless this is being called after
+        * device_del(), which should have done this already via kobject_del().
+        */
+       if (devfreq->dev.kobj.sd)
+               sysfs_remove_group(&devfreq->dev.kobj, &dev_attr_group);
+
        kfree(devfreq->data);
        devfreq->data = NULL;
 }