hwmon: (pmbus/core) Optimize debugfs block data attribute initialization
authorGuenter Roeck <linux@roeck-us.net>
Sun, 26 Jan 2025 20:42:18 +0000 (12:42 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 2 Mar 2025 16:49:01 +0000 (08:49 -0800)
commit2a431adc96395f3e1c971d10fb75c17275b60d1b
treeab643998873a6b1b171951b281e63295b69c7b0c
parent510db88a1c56abfbdb82c976f29bb3dc85a71c13
hwmon: (pmbus/core) Optimize debugfs block data attribute initialization

Define debugfs attributes which need block data access in a data
structure and loop through it instead of creating debugfs files
one by one. This reduces code size and simplifies adding additional
attributes if needed.

While this is currently only used for manufacturer specific attributes,
the access code is generic and also works for other block attributes,
so rename operation functions from _mfg to _block.

While at it, rename the "revison" file to "pmbus_revision" to make its
meaning more obvious and to create a clear distinction against the
"mfg_revision" file.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c