summary refs log tree commit diff
path: root/drivers/hwmon/lm70.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-06-02 09:58:08 -0700
committerGuenter Roeck <linux@roeck-us.net>2012-09-23 21:08:31 -0700
commit33ed6d4a82b7422a0ab2f97f19fc841670da99d4 (patch)
tree6e007e76c8ff3020bdcce3e16bb11e259b66724e /drivers/hwmon/lm70.c
parenta81b0f73d10add406fca13c91c73e6a3cd505b46 (diff)
downloadlinux-33ed6d4a82b7422a0ab2f97f19fc841670da99d4.tar.gz
hwmon: (lm70) 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/lm70.c')
-rw-r--r--drivers/hwmon/lm70.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index 472f79521a96..dd7f0cafd197 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -149,7 +149,7 @@ static int __devinit lm70_probe(struct spi_device *spi)
 
 	/* NOTE:  we assume 8-bit words, and convert to 16 bits manually */
 
-	p_lm70 = kzalloc(sizeof *p_lm70, GFP_KERNEL);
+	p_lm70 = devm_kzalloc(&spi->dev, sizeof(*p_lm70), GFP_KERNEL);
 	if (!p_lm70)
 		return -ENOMEM;
 
@@ -181,7 +181,6 @@ out_dev_create_file_failed:
 	device_remove_file(&spi->dev, &dev_attr_temp1_input);
 out_dev_create_temp_file_failed:
 	spi_set_drvdata(spi, NULL);
-	kfree(p_lm70);
 	return status;
 }
 
@@ -193,7 +192,6 @@ static int __devexit lm70_remove(struct spi_device *spi)
 	device_remove_file(&spi->dev, &dev_attr_temp1_input);
 	device_remove_file(&spi->dev, &dev_attr_name);
 	spi_set_drvdata(spi, NULL);
-	kfree(p_lm70);
 
 	return 0;
 }