aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 14:25:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 14:25:33 -0400
commitfa93669a1917f93b09142d4b2298329b82d7d36d (patch)
tree7f8d6dc9d1fbb086c59a799a3a7137c46fb9959e /drivers/power
parentb13bc8dda81c54a66a1c84e66f60b8feba659f28 (diff)
parent6791457a090d9a234a40b501c2536f0aefaeae4b (diff)
Merge tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core changes from Greg Kroah-Hartman: "Here's the big driver core pull request for 3.6-rc1. Unlike 3.5, this kernel should be a lot tamer, with the printk changes now settled down. All we have here is some extcon driver updates, w1 driver updates, a few printk cleanups that weren't needed for 3.5, but are good to have now, and some other minor fixes/changes in the driver core. All of these have been in the linux-next releases for a while now. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (38 commits) printk: Export struct log size and member offsets through vmcoreinfo Drivers: hv: Change the hex constant to a decimal constant driver core: don't trigger uevent after failure extcon: MAX77693: Add extcon-max77693 driver to support Maxim MAX77693 MUIC device sysfs: fail dentry revalidation after namespace change fix sysfs: fail dentry revalidation after namespace change extcon: spelling of detach in function doc extcon: arizona: Stop microphone detection if we give up on it extcon: arizona: Update cable reporting calls and split headset PM / Runtime: Do not increment device usage counts before probing kmsg - do not flush partial lines when the console is busy kmsg - export "continuation record" flag to /dev/kmsg kmsg - avoid warning for CONFIG_PRINTK=n compilations kmsg - properly print over-long continuation lines driver-core: Use kobj_to_dev instead of re-implementing it driver-core: Move kobj_to_dev from genhd.h to device.h driver core: Move deferred devices to the end of dpm_list before probing driver core: move uevent call to driver_register driver core: fix shutdown races with probe/remove(v3) Extcon: Arizona: Add driver for Wolfson Arizona class devices ...
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/ds2780_battery.c11
-rw-r--r--drivers/power/ds2781_battery.c12
2 files changed, 2 insertions, 21 deletions
diff --git a/drivers/power/ds2780_battery.c b/drivers/power/ds2780_battery.c
index de31cae1ba53..74fad941c56c 100644
--- a/drivers/power/ds2780_battery.c
+++ b/drivers/power/ds2780_battery.c
@@ -39,7 +39,6 @@ struct ds2780_device_info {
39 struct device *dev; 39 struct device *dev;
40 struct power_supply bat; 40 struct power_supply bat;
41 struct device *w1_dev; 41 struct device *w1_dev;
42 struct task_struct *mutex_holder;
43}; 42};
44 43
45enum current_types { 44enum current_types {
@@ -64,10 +63,7 @@ static inline struct power_supply *to_power_supply(struct device *dev)
64static inline int ds2780_battery_io(struct ds2780_device_info *dev_info, 63static inline int ds2780_battery_io(struct ds2780_device_info *dev_info,
65 char *buf, int addr, size_t count, int io) 64 char *buf, int addr, size_t count, int io)
66{ 65{
67 if (dev_info->mutex_holder == current) 66 return w1_ds2780_io(dev_info->w1_dev, buf, addr, count, io);
68 return w1_ds2780_io_nolock(dev_info->w1_dev, buf, addr, count, io);
69 else
70 return w1_ds2780_io(dev_info->w1_dev, buf, addr, count, io);
71} 67}
72 68
73static inline int ds2780_read8(struct ds2780_device_info *dev_info, u8 *val, 69static inline int ds2780_read8(struct ds2780_device_info *dev_info, u8 *val,
@@ -779,7 +775,6 @@ static int __devinit ds2780_battery_probe(struct platform_device *pdev)
779 dev_info->bat.properties = ds2780_battery_props; 775 dev_info->bat.properties = ds2780_battery_props;
780 dev_info->bat.num_properties = ARRAY_SIZE(ds2780_battery_props); 776 dev_info->bat.num_properties = ARRAY_SIZE(ds2780_battery_props);
781 dev_info->bat.get_property = ds2780_battery_get_property; 777 dev_info->bat.get_property = ds2780_battery_get_property;
782 dev_info->mutex_holder = current;
783 778
784 ret = power_supply_register(&pdev->dev, &dev_info->bat); 779 ret = power_supply_register(&pdev->dev, &dev_info->bat);
785 if (ret) { 780 if (ret) {
@@ -809,8 +804,6 @@ static int __devinit ds2780_battery_probe(struct platform_device *pdev)
809 goto fail_remove_bin_file; 804 goto fail_remove_bin_file;
810 } 805 }
811 806
812 dev_info->mutex_holder = NULL;
813
814 return 0; 807 return 0;
815 808
816fail_remove_bin_file: 809fail_remove_bin_file:
@@ -830,8 +823,6 @@ static int __devexit ds2780_battery_remove(struct platform_device *pdev)
830{ 823{
831 struct ds2780_device_info *dev_info = platform_get_drvdata(pdev); 824 struct ds2780_device_info *dev_info = platform_get_drvdata(pdev);
832 825
833 dev_info->mutex_holder = current;
834
835 /* remove attributes */ 826 /* remove attributes */
836 sysfs_remove_group(&dev_info->bat.dev->kobj, &ds2780_attr_group); 827 sysfs_remove_group(&dev_info->bat.dev->kobj, &ds2780_attr_group);
837 828
diff --git a/drivers/power/ds2781_battery.c b/drivers/power/ds2781_battery.c
index 975684a40f15..5f92a4bb33f9 100644
--- a/drivers/power/ds2781_battery.c
+++ b/drivers/power/ds2781_battery.c
@@ -37,7 +37,6 @@ struct ds2781_device_info {
37 struct device *dev; 37 struct device *dev;
38 struct power_supply bat; 38 struct power_supply bat;
39 struct device *w1_dev; 39 struct device *w1_dev;
40 struct task_struct *mutex_holder;
41}; 40};
42 41
43enum current_types { 42enum current_types {
@@ -62,11 +61,7 @@ static inline struct power_supply *to_power_supply(struct device *dev)
62static inline int ds2781_battery_io(struct ds2781_device_info *dev_info, 61static inline int ds2781_battery_io(struct ds2781_device_info *dev_info,
63 char *buf, int addr, size_t count, int io) 62 char *buf, int addr, size_t count, int io)
64{ 63{
65 if (dev_info->mutex_holder == current) 64 return w1_ds2781_io(dev_info->w1_dev, buf, addr, count, io);
66 return w1_ds2781_io_nolock(dev_info->w1_dev, buf, addr,
67 count, io);
68 else
69 return w1_ds2781_io(dev_info->w1_dev, buf, addr, count, io);
70} 65}
71 66
72int w1_ds2781_read(struct ds2781_device_info *dev_info, char *buf, 67int w1_ds2781_read(struct ds2781_device_info *dev_info, char *buf,
@@ -775,7 +770,6 @@ static int __devinit ds2781_battery_probe(struct platform_device *pdev)
775 dev_info->bat.properties = ds2781_battery_props; 770 dev_info->bat.properties = ds2781_battery_props;
776 dev_info->bat.num_properties = ARRAY_SIZE(ds2781_battery_props); 771 dev_info->bat.num_properties = ARRAY_SIZE(ds2781_battery_props);
777 dev_info->bat.get_property = ds2781_battery_get_property; 772 dev_info->bat.get_property = ds2781_battery_get_property;
778 dev_info->mutex_holder = current;
779 773
780 ret = power_supply_register(&pdev->dev, &dev_info->bat); 774 ret = power_supply_register(&pdev->dev, &dev_info->bat);
781 if (ret) { 775 if (ret) {
@@ -805,8 +799,6 @@ static int __devinit ds2781_battery_probe(struct platform_device *pdev)
805 goto fail_remove_bin_file; 799 goto fail_remove_bin_file;
806 } 800 }
807 801
808 dev_info->mutex_holder = NULL;
809
810 return 0; 802 return 0;
811 803
812fail_remove_bin_file: 804fail_remove_bin_file:
@@ -826,8 +818,6 @@ static int __devexit ds2781_battery_remove(struct platform_device *pdev)
826{ 818{
827 struct ds2781_device_info *dev_info = platform_get_drvdata(pdev); 819 struct ds2781_device_info *dev_info = platform_get_drvdata(pdev);
828 820
829 dev_info->mutex_holder = current;
830
831 /* remove attributes */ 821 /* remove attributes */
832 sysfs_remove_group(&dev_info->bat.dev->kobj, &ds2781_attr_group); 822 sysfs_remove_group(&dev_info->bat.dev->kobj, &ds2781_attr_group);
833 823