diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-01-20 05:05:07 (GMT) |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-03-19 01:27:40 (GMT) |
commit | 7599d32b1332546a3c0af17ce925ce7a8e89bfa1 (patch) | |
tree | 618457b176e86817c1bc116ae0b623cb27d25900 /drivers | |
parent | e200c14f60765ee3be6517659ec8fea06e299e39 (diff) | |
download | linux-7599d32b1332546a3c0af17ce925ce7a8e89bfa1.tar.xz |
hwmon: (lm70) Fix: do not use assignment in if condition
Fix checkpatch issue:
ERROR: do not use assignment in if condition
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/lm70.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c index 61c2ffb..472f795 100644 --- a/drivers/hwmon/lm70.c +++ b/drivers/hwmon/lm70.c @@ -158,11 +158,12 @@ static int __devinit lm70_probe(struct spi_device *spi) spi_set_drvdata(spi, p_lm70); - if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input)) - || (status = device_create_file(&spi->dev, &dev_attr_name))) { - dev_dbg(&spi->dev, "device_create_file failure.\n"); + status = device_create_file(&spi->dev, &dev_attr_temp1_input); + if (status) + goto out_dev_create_temp_file_failed; + status = device_create_file(&spi->dev, &dev_attr_name); + if (status) goto out_dev_create_file_failed; - } /* sysfs hook */ p_lm70->hwmon_dev = hwmon_device_register(&spi->dev); @@ -178,6 +179,7 @@ out_dev_reg_failed: device_remove_file(&spi->dev, &dev_attr_name); 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; |