]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jun 2019 03:35:59 +0000 (11:35 +0800)
commitd72a4c78c124dfd9fdb6a0404075e5e8fbfaa1ca
treea81385a7bd00ebd5cc11877cd705a285afe888dc
parent6029e58188053a925eb3a6bd42faf94cb4e839e9
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