diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-06-02 18:57:58 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-09-24 06:08:29 +0200 |
commit | c60da82593b30d3b3b97e80f6f74b5f4afa9d0b5 (patch) | |
tree | b18333948db64759befbe06a01556b92f1a586c7 /drivers/hwmon/adcxx.c | |
parent | hwmon: (ad7418) Convert to use devm_ functions (diff) | |
download | linux-c60da82593b30d3b3b97e80f6f74b5f4afa9d0b5.tar.xz linux-c60da82593b30d3b3b97e80f6f74b5f4afa9d0b5.zip |
hwmon: (adcxx) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/adcxx.c')
-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) int status; int i; - adc = kzalloc(sizeof *adc, GFP_KERNEL); + adc = devm_kzalloc(&spi->dev, sizeof(*adc), GFP_KERNEL); if (!adc) return -ENOMEM; @@ -208,7 +208,6 @@ out_err: spi_set_drvdata(spi, NULL); mutex_unlock(&adc->lock); - kfree(adc); return status; } @@ -224,7 +223,6 @@ static int __devexit adcxx_remove(struct spi_device *spi) spi_set_drvdata(spi, NULL); mutex_unlock(&adc->lock); - kfree(adc); return 0; } |