diff options
Diffstat (limited to 'drivers/power/ds2781_battery.c')
-rw-r--r-- | drivers/power/ds2781_battery.c | 12 |
1 files changed, 1 insertions, 11 deletions
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 | ||
43 | enum current_types { | 42 | enum current_types { |
@@ -62,11 +61,7 @@ static inline struct power_supply *to_power_supply(struct device *dev) | |||
62 | static inline int ds2781_battery_io(struct ds2781_device_info *dev_info, | 61 | static 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 | ||
72 | int w1_ds2781_read(struct ds2781_device_info *dev_info, char *buf, | 67 | int 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 | ||
812 | fail_remove_bin_file: | 804 | fail_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 | ||