]> git.karo-electronics.de Git - linux-beck.git/commitdiff
hwmon: (lm70) Fix: do not use assignment in if condition
authorGuenter Roeck <linux@roeck-us.net>
Fri, 20 Jan 2012 05:05:07 +0000 (21:05 -0800)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Mon, 19 Mar 2012 01:27:40 +0000 (18:27 -0700)
Fix checkpatch issue:
ERROR: do not use assignment in if condition

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm70.c

index 61c2ffbb9dd021e4e5be0eb5f0a4a3a993df4c03..472f79521a96f1b29e9205e557bd0a3823c2b98b 100644 (file)
@@ -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;