hwmon: (tps23861) reduce count of i2c transactions for port_status
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>
Wed, 7 Sep 2022 01:54:04 +0000 (20:54 -0500)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 19 Sep 2022 13:17:06 +0000 (06:17 -0700)
commit0fed840c7562d9dcc5bf8a91744b079e952683d1
tree7f3bebc9ae98b5308ce156fa97518d5db8ef74a8
parent4444a06981af66a49cf0cd08fec9759e8dd0a0fc
hwmon: (tps23861) reduce count of i2c transactions for port_status

When reading the 'port_status' debugfs entry, some I2C registers were
read more than once. This looks inefficient in an I2C trace.

To reduce I2C traffic, update tps23861_port_status_show() to only read
each register once. Indexing the port number from 0 instead of 1 also
allows simplifying things a bit.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Link: https://lore.kernel.org/r/20220907015405.16547-1-mr.nuke.me@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/tps23861.c