aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adcxx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 19:52:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 19:52:50 -0400
commit0c63e38a129e7b1f625c6112439a4efc87b1635c (patch)
treebde880587c6a1da9eee2d44d3036b56e0d557f07 /drivers/hwmon/adcxx.c
parent0798b1dbfbd9ff2a370c5968c5f0621ef0075fe0 (diff)
parentb0b349a85d3df00a40a8bd398e4a151fd8e91bbe (diff)
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: New driver for the SMSC EMC6W201 hwmon: (abituguru) Depend on DMI hwmon: (it87) Use request_muxed_region hwmon: (sch5627) Trigger Vbat measurements hwmon: (sch5627) Add sch5627_send_cmd function i8k: Integrate with the hwmon subsystem hwmon: (max6650) Properly support the MAX6650 hwmon: (max6650) Drop device detection Move ACPI power meter driver to hwmon hwmon: (f71882fg) Add support for F71808A hwmon: (f71882fg) Split has_beep in fan_has_beep and temp_has_beep hwmon: (asc7621) Drop duplicate dependency hwmon: (jc42) Change detection class hwmon: Add driver for AMD family 15h processor power information hwmon: (k10temp) Add support for Fam15h (Bulldozer) hwmon: Use helper functions to set and get driver data i8k: Avoid lahf in 64-bit code
Diffstat (limited to 'drivers/hwmon/adcxx.c')
-rw-r--r--drivers/hwmon/adcxx.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c
index fbdc7655303b..b2cacbe707a8 100644
--- a/drivers/hwmon/adcxx.c
+++ b/drivers/hwmon/adcxx.c
@@ -62,7 +62,7 @@ static ssize_t adcxx_read(struct device *dev,
62{ 62{
63 struct spi_device *spi = to_spi_device(dev); 63 struct spi_device *spi = to_spi_device(dev);
64 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 64 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
65 struct adcxx *adc = dev_get_drvdata(&spi->dev); 65 struct adcxx *adc = spi_get_drvdata(spi);
66 u8 tx_buf[2]; 66 u8 tx_buf[2];
67 u8 rx_buf[2]; 67 u8 rx_buf[2];
68 int status; 68 int status;
@@ -105,7 +105,7 @@ static ssize_t adcxx_show_max(struct device *dev,
105 struct device_attribute *devattr, char *buf) 105 struct device_attribute *devattr, char *buf)
106{ 106{
107 struct spi_device *spi = to_spi_device(dev); 107 struct spi_device *spi = to_spi_device(dev);
108 struct adcxx *adc = dev_get_drvdata(&spi->dev); 108 struct adcxx *adc = spi_get_drvdata(spi);
109 u32 reference; 109 u32 reference;
110 110
111 if (mutex_lock_interruptible(&adc->lock)) 111 if (mutex_lock_interruptible(&adc->lock))
@@ -122,7 +122,7 @@ static ssize_t adcxx_set_max(struct device *dev,
122 struct device_attribute *devattr, const char *buf, size_t count) 122 struct device_attribute *devattr, const char *buf, size_t count)
123{ 123{
124 struct spi_device *spi = to_spi_device(dev); 124 struct spi_device *spi = to_spi_device(dev);
125 struct adcxx *adc = dev_get_drvdata(&spi->dev); 125 struct adcxx *adc = spi_get_drvdata(spi);
126 unsigned long value; 126 unsigned long value;
127 127
128 if (strict_strtoul(buf, 10, &value)) 128 if (strict_strtoul(buf, 10, &value))
@@ -142,7 +142,7 @@ static ssize_t adcxx_show_name(struct device *dev, struct device_attribute
142 *devattr, char *buf) 142 *devattr, char *buf)
143{ 143{
144 struct spi_device *spi = to_spi_device(dev); 144 struct spi_device *spi = to_spi_device(dev);
145 struct adcxx *adc = dev_get_drvdata(&spi->dev); 145 struct adcxx *adc = spi_get_drvdata(spi);
146 146
147 return sprintf(buf, "adcxx%ds\n", adc->channels); 147 return sprintf(buf, "adcxx%ds\n", adc->channels);
148} 148}
@@ -182,7 +182,7 @@ static int __devinit adcxx_probe(struct spi_device *spi)
182 182
183 mutex_lock(&adc->lock); 183 mutex_lock(&adc->lock);
184 184
185 dev_set_drvdata(&spi->dev, adc); 185 spi_set_drvdata(spi, adc);
186 186
187 for (i = 0; i < 3 + adc->channels; i++) { 187 for (i = 0; i < 3 + adc->channels; i++) {
188 status = device_create_file(&spi->dev, &ad_input[i].dev_attr); 188 status = device_create_file(&spi->dev, &ad_input[i].dev_attr);
@@ -206,7 +206,7 @@ out_err:
206 for (i--; i >= 0; i--) 206 for (i--; i >= 0; i--)
207 device_remove_file(&spi->dev, &ad_input[i].dev_attr); 207 device_remove_file(&spi->dev, &ad_input[i].dev_attr);
208 208
209 dev_set_drvdata(&spi->dev, NULL); 209 spi_set_drvdata(spi, NULL);
210 mutex_unlock(&adc->lock); 210 mutex_unlock(&adc->lock);
211 kfree(adc); 211 kfree(adc);
212 return status; 212 return status;
@@ -214,7 +214,7 @@ out_err:
214 214
215static int __devexit adcxx_remove(struct spi_device *spi) 215static int __devexit adcxx_remove(struct spi_device *spi)
216{ 216{
217 struct adcxx *adc = dev_get_drvdata(&spi->dev); 217 struct adcxx *adc = spi_get_drvdata(spi);
218 int i; 218 int i;
219 219
220 mutex_lock(&adc->lock); 220 mutex_lock(&adc->lock);
@@ -222,7 +222,7 @@ static int __devexit adcxx_remove(struct spi_device *spi)
222 for (i = 0; i < 3 + adc->channels; i++) 222 for (i = 0; i < 3 + adc->channels; i++)
223 device_remove_file(&spi->dev, &ad_input[i].dev_attr); 223 device_remove_file(&spi->dev, &ad_input[i].dev_attr);
224 224
225 dev_set_drvdata(&spi->dev, NULL); 225 spi_set_drvdata(spi, NULL);
226 mutex_unlock(&adc->lock); 226 mutex_unlock(&adc->lock);
227 kfree(adc); 227 kfree(adc);
228 228