Commit 7599d32b1332546a3c0af17ce925ce7a8e89bfa1
Committed by
Guenter Roeck
1 parent
e200c14f60
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 6 additions and 4 deletions Side-by-side Diff
drivers/hwmon/lm70.c
... | ... | @@ -158,11 +158,12 @@ |
158 | 158 | |
159 | 159 | spi_set_drvdata(spi, p_lm70); |
160 | 160 | |
161 | - if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input)) | |
162 | - || (status = device_create_file(&spi->dev, &dev_attr_name))) { | |
163 | - dev_dbg(&spi->dev, "device_create_file failure.\n"); | |
161 | + status = device_create_file(&spi->dev, &dev_attr_temp1_input); | |
162 | + if (status) | |
163 | + goto out_dev_create_temp_file_failed; | |
164 | + status = device_create_file(&spi->dev, &dev_attr_name); | |
165 | + if (status) | |
164 | 166 | goto out_dev_create_file_failed; |
165 | - } | |
166 | 167 | |
167 | 168 | /* sysfs hook */ |
168 | 169 | p_lm70->hwmon_dev = hwmon_device_register(&spi->dev); |
... | ... | @@ -178,6 +179,7 @@ |
178 | 179 | device_remove_file(&spi->dev, &dev_attr_name); |
179 | 180 | out_dev_create_file_failed: |
180 | 181 | device_remove_file(&spi->dev, &dev_attr_temp1_input); |
182 | +out_dev_create_temp_file_failed: | |
181 | 183 | spi_set_drvdata(spi, NULL); |
182 | 184 | kfree(p_lm70); |
183 | 185 | return status; |