Skip to contentSkip to conversation

hwmon: Update documentation to clarify rules for the 'name' attribute

PATCH In review Guenter Roeck 2 participants 2 messages Jan 25, 2017

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH v2 1/1 hwmon: Update documentation to clarify rules for the 'name' attribute

Clarify that the name attribute must report a valid name, and the rules for valid names. Also clarify that the name parameter must be provided for all supported API functions.

---
v2: '.' is an acceptable character in the 'name' attribute.

 Documentation/hwmon/hwmon-kernel-api.txt | 4 ++++
 Documentation/hwmon/sysfs-interface      | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
Documentation/hwmon/hwmon-kernel-api.txt +4 -0
index 2505ae67e2b6..53a806696c64 100644
@@ -89,6 +89,10 @@ the call to devm_hwmon_device_register_with_groups or
 hwmon_device_register_with_info and if the automatic (device managed)
 removal would be too late.
 
+All supported hwmon device registration functions only accept valid device
+names. Device names including invalid characters (whitespace, '*', or '-')
+will be rejected. The 'name' parameter is mandatory.
+
 Using devm_hwmon_device_register_with_info()
 --------------------------------------------
 
Documentation/hwmon/sysfs-interface +3 -2
index 2cc95ad46604..fc337c317c67 100644
@@ -86,8 +86,9 @@ given driver if the chip has the feature.
 
 name		The chip name.
 		This should be a short, lowercase string, not containing
-		spaces nor dashes, representing the chip name. This is
-		the only mandatory attribute.
+		whitespace, dashes, or the wildcard character '*'.
+		This attribute represents the chip name. It is the only
+		mandatory attribute.
 		I2C devices get this attribute created automatically.
 		RO
 
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 33 lines · Guenter Roeck

Clarify that the name attribute must report a valid name, and the rules for valid names. Also clarify that the name parameter must be provided for all supported API functions.

---
v2: '.' is an acceptable character in the 'name' attribute.

 Documentation/hwmon/hwmon-kernel-api.txt | 4 ++++
 Documentation/hwmon/sysfs-interface      | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
Documentation/hwmon/hwmon-kernel-api.txt +4 -0
index 2505ae67e2b6..53a806696c64 100644
@@ -89,6 +89,10 @@ the call to devm_hwmon_device_register_with_groups or
 hwmon_device_register_with_info and if the automatic (device managed)
 removal would be too late.
 
+All supported hwmon device registration functions only accept valid device
+names. Device names including invalid characters (whitespace, '*', or '-')
+will be rejected. The 'name' parameter is mandatory.
+
 Using devm_hwmon_device_register_with_info()
 --------------------------------------------
 
Documentation/hwmon/sysfs-interface +0 -0
index 2cc95ad46604..fc337c317c67 100644
@@ -86,8 +86,9 @@ given driver if the chip has the feature.
 

Documentation/hwmon/sysfs-interface given driver if the chip has the feature. · line 94

Quoted 10 lines
Documentation/hwmon/sysfs-interface +3 -2
 name		The chip name.
 		This should be a short, lowercase string, not containing
-		spaces nor dashes, representing the chip name. This is
-		the only mandatory attribute.
+		whitespace, dashes, or the wildcard character '*'.
+		This attribute represents the chip name. It is the only
+		mandatory attribute.
 		I2C devices get this attribute created automatically.
 		RO
 

Thanks,

Signature · 2 lines
Jean Delvare
SUSE L3 Support