lkml.org 
[lkml]   [2022]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/9] trinity: Add sysfs debugfs module
On Mon, Jul 25, 2022 at 03:53:04PM +0900, Jiho Chu wrote:
> This patch includes debugfs and sysfs interfaces.

debugfs and sysfs are two totally different things, with different rules
and requirements. Split this up into at least 2 different patches and
don't mush them all together.

Would you want to try to review 2000+ lines of this type of thing that
does two totally different things at the same time?

Also, you forgot the sysfs Documentation/ABI/ entries, which are
required as you know.

And finally, you should never do this:

> +int trinity_sysfs_init(struct trinity_driver *drv)
> +{
> + struct device *dev = drv_to_dev_ptr(drv);
> + int err;
> +
> + err = sysfs_create_groups(&dev->kobj, trinity_attrs_groups);


You just raced with userspace and lost. Use the default groups pointer
for your driver and all will be fine. Makes for much smaller code that
works properly.

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-07-27 15:26    [W:1.814 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site