hwmon: (pmbus) Allow phase function even if it's not on page

Allow the use of a phase function even if it does not exist on
the associated page.

Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Erik Rosen 2021-06-09 11:32:07 +02:00 committed by Guenter Roeck
parent e8e00c83a2
commit 5e86f128d9
1 changed files with 8 additions and 8 deletions

View File

@ -1329,14 +1329,14 @@ static int pmbus_add_sensor_attrs(struct i2c_client *client,
pages = paged ? info->pages : 1;
for (page = 0; page < pages; page++) {
if (!(info->func[page] & attrs->func))
continue;
ret = pmbus_add_sensor_attrs_one(client, data, info,
name, index, page,
0xff, attrs, paged);
if (ret)
return ret;
index++;
if (info->func[page] & attrs->func) {
ret = pmbus_add_sensor_attrs_one(client, data, info,
name, index, page,
0xff, attrs, paged);
if (ret)
return ret;
index++;
}
if (info->phases[page]) {
int phase;