@@ -1057,6 +1057,26 @@ void devm_hwmon_device_unregister(struct device *dev)
}
EXPORT_SYMBOL_GPL(devm_hwmon_device_unregister);
+/**
+ * hwmon_is_bad_char - Is the char invalid in a hwmon name
+ * @ch: the char to be considered
+ *
+ * Returns true if the char is invalid, false otherwise.
+ */
+static bool hwmon_is_bad_char(const char ch)
+{
+ switch (ch) {
+ case '-':
+ case '*':
+ case ' ':
+ case '\t':
+ case '\n':
+ return true;
+ default:
+ return false;
+ }
+}
+
static char *__hwmon_sanitize_name(struct device *dev, const char *old_name)
{
char *name, *p;
@@ -464,27 +464,4 @@ int hwmon_notify_event(struct device *dev, enum hwmon_sensor_types type,
char *hwmon_sanitize_name(const char *name);
char *devm_hwmon_sanitize_name(struct device *dev, const char *name);
-/**
- * hwmon_is_bad_char - Is the char invalid in a hwmon name
- * @ch: the char to be considered
- *
- * hwmon_is_bad_char() can be used to determine if the given character
- * may not be used in a hwmon name.
- *
- * Returns true if the char is invalid, false otherwise.
- */
-static inline bool hwmon_is_bad_char(const char ch)
-{
- switch (ch) {
- case '-':
- case '*':
- case ' ':
- case '\t':
- case '\n':
- return true;
- default:
- return false;
- }
-}
-
#endif
With the last user of this function converted to hwmon_sanitize_name(), move the function into the core itself and make it private. Signed-off-by: Michael Walle <michael@walle.cc> --- drivers/hwmon/hwmon.c | 20 ++++++++++++++++++++ include/linux/hwmon.h | 23 ----------------------- 2 files changed, 20 insertions(+), 23 deletions(-)