Commit e8ab508c authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (nct6775) Use return value from find_temp_source

smatch complains that we don't use the return value from find_temp_source().
Valid point, only find_temp_source() doesn't return a valid error code.
Have it return a valid error code and use it.
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent a0393713
...@@ -1545,7 +1545,7 @@ static int find_temp_source(struct nct6775_data *data, int index, int count) ...@@ -1545,7 +1545,7 @@ static int find_temp_source(struct nct6775_data *data, int index, int count)
if (src == source) if (src == source)
return nr; return nr;
} }
return -1; return -ENODEV;
} }
static ssize_t static ssize_t
...@@ -1644,7 +1644,7 @@ store_temp_beep(struct device *dev, struct device_attribute *attr, ...@@ -1644,7 +1644,7 @@ store_temp_beep(struct device *dev, struct device_attribute *attr,
nr = find_temp_source(data, sattr->index, data->num_temp_beeps); nr = find_temp_source(data, sattr->index, data->num_temp_beeps);
if (nr < 0) if (nr < 0)
return -ENODEV; return nr;
bit = data->BEEP_BITS[nr + TEMP_ALARM_BASE]; bit = data->BEEP_BITS[nr + TEMP_ALARM_BASE];
regindex = bit >> 3; regindex = bit >> 3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment