aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/lm70.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index 61c2ffbb9dd0..472f79521a96 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -158,11 +158,12 @@ static int __devinit lm70_probe(struct spi_device *spi)
158 158
159 spi_set_drvdata(spi, p_lm70); 159 spi_set_drvdata(spi, p_lm70);
160 160
161 if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input)) 161 status = device_create_file(&spi->dev, &dev_attr_temp1_input);
162 || (status = device_create_file(&spi->dev, &dev_attr_name))) { 162 if (status)
163 dev_dbg(&spi->dev, "device_create_file failure.\n"); 163 goto out_dev_create_temp_file_failed;
164 status = device_create_file(&spi->dev, &dev_attr_name);
165 if (status)
164 goto out_dev_create_file_failed; 166 goto out_dev_create_file_failed;
165 }
166 167
167 /* sysfs hook */ 168 /* sysfs hook */
168 p_lm70->hwmon_dev = hwmon_device_register(&spi->dev); 169 p_lm70->hwmon_dev = hwmon_device_register(&spi->dev);
@@ -178,6 +179,7 @@ out_dev_reg_failed:
178 device_remove_file(&spi->dev, &dev_attr_name); 179 device_remove_file(&spi->dev, &dev_attr_name);
179out_dev_create_file_failed: 180out_dev_create_file_failed:
180 device_remove_file(&spi->dev, &dev_attr_temp1_input); 181 device_remove_file(&spi->dev, &dev_attr_temp1_input);
182out_dev_create_temp_file_failed:
181 spi_set_drvdata(spi, NULL); 183 spi_set_drvdata(spi, NULL);
182 kfree(p_lm70); 184 kfree(p_lm70);
183 return status; 185 return status;