diff options
Diffstat (limited to 'drivers/hwmon/adcxx.c')
-rw-r--r-- | drivers/hwmon/adcxx.c | 16 |
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 | ||
215 | static int __devexit adcxx_remove(struct spi_device *spi) | 215 | static 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 | ||