* [PATCH] hwmon: Update documentation to clarify rules for the 'name' attribute
@ 2017-01-25 4:26 Guenter Roeck
2017-01-25 9:14 ` Jean Delvare
0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2017-01-25 4:26 UTC (permalink / raw)
To: Hardware Monitoring; +Cc: Jean Delvare, 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.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Documentation/hwmon/hwmon-kernel-api.txt | 4 ++++
Documentation/hwmon/sysfs-interface | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt
index 2505ae67e2b6..41bc15b34737 100644
--- a/Documentation/hwmon/hwmon-kernel-api.txt
+++ b/Documentation/hwmon/hwmon-kernel-api.txt
@@ -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()
--------------------------------------------
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index 2cc95ad46604..89f0bcbcaa18 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -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 characters '.' and '*'.
+ This attribute represents the chip name. It is the only
+ mandatory attribute.
I2C devices get this attribute created automatically.
RO
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hwmon: Update documentation to clarify rules for the 'name' attribute
2017-01-25 4:26 [PATCH] hwmon: Update documentation to clarify rules for the 'name' attribute Guenter Roeck
@ 2017-01-25 9:14 ` Jean Delvare
2017-01-25 9:24 ` Guenter Roeck
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2017-01-25 9:14 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Hardware Monitoring
Hi Guenter,
On Tue, 24 Jan 2017 20:26:34 -0800, Guenter Roeck wrote:
> 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.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Documentation/hwmon/hwmon-kernel-api.txt | 4 ++++
> Documentation/hwmon/sysfs-interface | 5 +++--
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt
> index 2505ae67e2b6..41bc15b34737 100644
> --- a/Documentation/hwmon/hwmon-kernel-api.txt
> +++ b/Documentation/hwmon/hwmon-kernel-api.txt
> @@ -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, '.'. '*',
Typo: should be , after '.' instead of . .
I am confused as to why '.' is forbidden. The code in
__hwmon_device_register() does not reject that character, and I can't
see how this would cause any problem to libsensors.
> +or '-') will be rejected. The 'name' parameter is mandatory.
> +
> Using devm_hwmon_device_register_with_info()
> --------------------------------------------
>
> diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
> index 2cc95ad46604..89f0bcbcaa18 100644
> --- a/Documentation/hwmon/sysfs-interface
> +++ b/Documentation/hwmon/sysfs-interface
> @@ -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 characters '.' and '*'.
> + This attribute represents the chip name. It is the only
> + mandatory attribute.
> I2C devices get this attribute created automatically.
> RO
>
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hwmon: Update documentation to clarify rules for the 'name' attribute
2017-01-25 9:14 ` Jean Delvare
@ 2017-01-25 9:24 ` Guenter Roeck
0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2017-01-25 9:24 UTC (permalink / raw)
To: Jean Delvare; +Cc: Hardware Monitoring
On 01/25/2017 01:14 AM, Jean Delvare wrote:
> Hi Guenter,
>
> On Tue, 24 Jan 2017 20:26:34 -0800, Guenter Roeck wrote:
>> 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.
>>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>> Documentation/hwmon/hwmon-kernel-api.txt | 4 ++++
>> Documentation/hwmon/sysfs-interface | 5 +++--
>> 2 files changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt
>> index 2505ae67e2b6..41bc15b34737 100644
>> --- a/Documentation/hwmon/hwmon-kernel-api.txt
>> +++ b/Documentation/hwmon/hwmon-kernel-api.txt
>> @@ -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, '.'. '*',
>
> Typo: should be , after '.' instead of . .
>
> I am confused as to why '.' is forbidden. The code in
> __hwmon_device_register() does not reject that character, and I can't
> see how this would cause any problem to libsensors.
>
Maybe I should read the code ;-).
Thanks, I'll send an update !
Guenter
>> +or '-') will be rejected. The 'name' parameter is mandatory.
>> +
>> Using devm_hwmon_device_register_with_info()
>> --------------------------------------------
>>
>> diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
>> index 2cc95ad46604..89f0bcbcaa18 100644
>> --- a/Documentation/hwmon/sysfs-interface
>> +++ b/Documentation/hwmon/sysfs-interface
>> @@ -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 characters '.' and '*'.
>> + This attribute represents the chip name. It is the only
>> + mandatory attribute.
>> I2C devices get this attribute created automatically.
>> RO
>>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-25 9:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 4:26 [PATCH] hwmon: Update documentation to clarify rules for the 'name' attribute Guenter Roeck
2017-01-25 9:14 ` Jean Delvare
2017-01-25 9:24 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.