Re: [PATCH] misc: ad525x_dpot: fix sysfs cleanup paths
From: Greg Kroah-Hartman
Date: Mon Jun 15 2026 - 03:02:28 EST
On Mon, Jun 15, 2026 at 02:51:40PM +0800, Pengpeng Hou wrote:
> ad_dpot_probe() creates per-RDAC sysfs files and then, for devices with
> increment/decrement commands, creates the command sysfs group.
Which is the incorrect way of creating sysfs files for many reasons, not
the least being what you found here.
Please fix this by using a default group and the is_visable() callback
instead. That way it will "just work" as the driver core will handle
all of this properly.
Huge hint, whenever a driver calls a sysfs_*() function, it is doing
something wrong.
thanks,
greg k-h