* hwmon: w83781d: Unused sysfs group w83781d_group_other
@ 2017-01-02 21:49 Alexey Khoroshilov
2017-01-03 4:25 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2017-01-02 21:49 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck
Cc: Alexey Khoroshilov, linux-hwmon, linux-kernel, ldv-project
Hello,
w83781d.c contains a definition of sysfs group:
static const struct attribute_group w83781d_group_other = {
.attrs = w83781d_attributes_other,
};
the only usage of which is:
static void w83781d_remove_files(struct device *dev)
{
...
sysfs_remove_group(&dev->kobj, &w83781d_group_other);
}
So, it seems the group should be either created in w83781d_create_files() or removed completely.
What do you think?
Found by Linux Driver Verification project (linuxtesting.org).
--
Alexey Khoroshilov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: hwmon: w83781d: Unused sysfs group w83781d_group_other
2017-01-02 21:49 hwmon: w83781d: Unused sysfs group w83781d_group_other Alexey Khoroshilov
@ 2017-01-03 4:25 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-01-03 4:25 UTC (permalink / raw)
To: Alexey Khoroshilov, Jean Delvare; +Cc: linux-hwmon, linux-kernel, ldv-project
On 01/02/2017 01:49 PM, Alexey Khoroshilov wrote:
> Hello,
>
> w83781d.c contains a definition of sysfs group:
>
> static const struct attribute_group w83781d_group_other = {
> .attrs = w83781d_attributes_other,
> };
>
> the only usage of which is:
>
> static void w83781d_remove_files(struct device *dev)
> {
> ...
> sysfs_remove_group(&dev->kobj, &w83781d_group_other);
> }
>
> So, it seems the group should be either created in w83781d_create_files() or removed completely.
> What do you think?
>
If you look very closely, you'll see that the attributes are created individually
using device_create_file(). Given that, removing the group might not be such a
good idea.
Yes, this is messy. If you have the time, feel free to convert the driver to use
hwmon_device_register_with_groups() or, even better, hwmon_device_register_with_info().
Thanks,
Guenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-03 4:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-02 21:49 hwmon: w83781d: Unused sysfs group w83781d_group_other Alexey Khoroshilov
2017-01-03 4:25 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).