]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus/core) Treat parameters as paged if on multiple pages
authorRobert Hancock <hancock@sedsystems.ca>
Wed, 5 Jun 2019 19:49:00 +0000 (13:49 -0600)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 6 Jun 2019 01:36:27 +0000 (18:36 -0700)
commiteaea26ac33b8c635b00265d33d4b5b0278f73bb8
treede343130d5efe0fa2201eb2b61b88657d3777f27
parenteb773539351fff31df6706658f9f59e4d31a678f
hwmon: (pmbus/core) Treat parameters as paged if on multiple pages

Some chips have attributes which exist on more than one page but the
attribute is not presently marked as paged. This causes the attributes
to be generated with the same label, which makes it impossible for
userspace to tell them apart.

Marking all such attributes as paged would result in the page suffix
being added regardless of whether they were present on more than one
page or not, which might break existing setups. Therefore, we add a
second check which treats the attribute as paged, even if not marked as
such, if it is present on multiple pages.

Fixes: 1a7e72775d41 ("hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registers")
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c