]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (iio_hwmon) Simplify attr.name generation in iio_hwmon_probe()
authorAndrey Smirnov <andrew.smirnov@gmail.com>
Wed, 3 Apr 2019 04:28:11 +0000 (21:28 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 16 Apr 2019 00:19:53 +0000 (17:19 -0700)
commitc59055e5b3328a0ffba6730838549da9b2d96eb6
tree5d62349974914a2329e4bbc5d2ce28e70bce9ec1
parent56d691cf3733baa3a539fecf8ef0042c59a621f0
hwmon: (iio_hwmon) Simplify attr.name generation in iio_hwmon_probe()

Since every call to devm_kasprintf() in the switch statement is mostly
the same, we can move all of the shared code outside and capture
differencies with two helper variables. No functional change intended.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/iio_hwmon.c