OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:56:33 +0000 (09:56 +0200)
commit66f0f0fdb9b96d931e479b5c9ea3305f68b3743b
treedc52d43b5d322fe82b7ad5da060aa7f0112bf543
parent4847348903fb41d5a3fb0eab58f4d766514fe877
hwmon: (pmbus/core) Treat parameters as paged if on multiple pages

[ Upstream commit 4a60570dce658e3f8885bbcf852430b99f65aca5 ]

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: b4ce237b7f7d ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/pmbus/pmbus_core.c