]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
hwmon: Add helper to tell if a char is invalid in a name
authorAndrew Lunn <andrew@lunn.ch>
Tue, 17 Jul 2018 19:48:12 +0000 (21:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jul 2018 01:01:46 +0000 (10:01 +0900)
commitdcb5d0fcaa1ddd0af9c18ef51e6b05e38a6cec71
tree6df2dadc6a18ce56330c1b0ac18fd3495d9ae23a
parentaa7f29b07c8702127124d0522e3cd46850cdbc41
hwmon: Add helper to tell if a char is invalid in a name

HWMON device names are not allowed to contain "-* \t\n". Add a helper
which will return true if passed an invalid character. It can be used
to massage a string into a hwmon compatible name by replacing invalid
characters with '_'.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/hwmon.h