hwmon: introduce hwmon_sanitize_name()
authorMichael Walle <michael@walle.cc>
Tue, 5 Apr 2022 09:24:51 +0000 (11:24 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 17 May 2022 12:52:59 +0000 (05:52 -0700)
commit1ad6c3b7ef132e1d8c5d606008069724625c8daf
treec90b3153ca16a77a6605148c66d2cd2fda75dea7
parent752b927951eaa6297bffc12efe603df10496566e
hwmon: introduce hwmon_sanitize_name()

More and more drivers will check for bad characters in the hwmon name
and all are using the same code snippet. Consolidate that code by adding
a new hwmon_sanitize_name() function.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20220405092452.4033674-2-michael@walle.cc
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/hwmon-kernel-api.rst
drivers/hwmon/hwmon.c
include/linux/hwmon.h