aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/bus.c1
-rw-r--r--drivers/base/core.c6
-rw-r--r--drivers/base/power/common.c12
3 files changed, 11 insertions, 8 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 1a68f947ded8..d414331b480e 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -1295,6 +1295,7 @@ int subsys_virtual_register(struct bus_type *subsys,
1295 1295
1296 return subsys_register(subsys, groups, virtual_dir); 1296 return subsys_register(subsys, groups, virtual_dir);
1297} 1297}
1298EXPORT_SYMBOL_GPL(subsys_virtual_register);
1298 1299
1299int __init buses_init(void) 1300int __init buses_init(void)
1300{ 1301{
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 016312437577..2499cefdcdf2 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -572,9 +572,11 @@ int device_create_file(struct device *dev,
572 572
573 if (dev) { 573 if (dev) {
574 WARN(((attr->attr.mode & S_IWUGO) && !attr->store), 574 WARN(((attr->attr.mode & S_IWUGO) && !attr->store),
575 "Write permission without 'store'\n"); 575 "Attribute %s: write permission without 'store'\n",
576 attr->attr.name);
576 WARN(((attr->attr.mode & S_IRUGO) && !attr->show), 577 WARN(((attr->attr.mode & S_IRUGO) && !attr->show),
577 "Read permission without 'show'\n"); 578 "Attribute %s: read permission without 'show'\n",
579 attr->attr.name);
578 error = sysfs_create_file(&dev->kobj, &attr->attr); 580 error = sysfs_create_file(&dev->kobj, &attr->attr);
579 } 581 }
580 582
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index 39c32529b833..5da914041305 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -61,24 +61,24 @@ EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data);
61int dev_pm_put_subsys_data(struct device *dev) 61int dev_pm_put_subsys_data(struct device *dev)
62{ 62{
63 struct pm_subsys_data *psd; 63 struct pm_subsys_data *psd;
64 int ret = 0; 64 int ret = 1;
65 65
66 spin_lock_irq(&dev->power.lock); 66 spin_lock_irq(&dev->power.lock);
67 67
68 psd = dev_to_psd(dev); 68 psd = dev_to_psd(dev);
69 if (!psd) { 69 if (!psd)
70 ret = -EINVAL;
71 goto out; 70 goto out;
72 }
73 71
74 if (--psd->refcount == 0) { 72 if (--psd->refcount == 0) {
75 dev->power.subsys_data = NULL; 73 dev->power.subsys_data = NULL;
76 kfree(psd); 74 } else {
77 ret = 1; 75 psd = NULL;
76 ret = 0;
78 } 77 }
79 78
80 out: 79 out:
81 spin_unlock_irq(&dev->power.lock); 80 spin_unlock_irq(&dev->power.lock);
81 kfree(psd);
82 82
83 return ret; 83 return ret;
84} 84}