diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/adcxx.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c index a3d3183454ad..111af7c4a3d4 100644 --- a/drivers/hwmon/adcxx.c +++ b/drivers/hwmon/adcxx.c | |||
@@ -171,7 +171,7 @@ static int __devinit adcxx_probe(struct spi_device *spi) | |||
171 | int status; | 171 | int status; |
172 | int i; | 172 | int i; |
173 | 173 | ||
174 | adc = kzalloc(sizeof *adc, GFP_KERNEL); | 174 | adc = devm_kzalloc(&spi->dev, sizeof(*adc), GFP_KERNEL); |
175 | if (!adc) | 175 | if (!adc) |
176 | return -ENOMEM; | 176 | return -ENOMEM; |
177 | 177 | ||
@@ -208,7 +208,6 @@ out_err: | |||
208 | 208 | ||
209 | spi_set_drvdata(spi, NULL); | 209 | spi_set_drvdata(spi, NULL); |
210 | mutex_unlock(&adc->lock); | 210 | mutex_unlock(&adc->lock); |
211 | kfree(adc); | ||
212 | return status; | 211 | return status; |
213 | } | 212 | } |
214 | 213 | ||
@@ -224,7 +223,6 @@ static int __devexit adcxx_remove(struct spi_device *spi) | |||
224 | 223 | ||
225 | spi_set_drvdata(spi, NULL); | 224 | spi_set_drvdata(spi, NULL); |
226 | mutex_unlock(&adc->lock); | 225 | mutex_unlock(&adc->lock); |
227 | kfree(adc); | ||
228 | 226 | ||
229 | return 0; | 227 | return 0; |
230 | } | 228 | } |