[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v4 17/17] virt: acrn: Introduce an interface for Service VM to control vCPU
On Mon, Sep 28, 2020 at 12:10:07PM +0800, Shuo A Liu wrote:
> > You just raced with userspace and lost. If you want to add attribute
> > files to a device, use the default attribute group list, and it will be
> > managed properly for you by the driver core.
> >
> > Huge hint, if a driver every has to touch a kobject, or call sysfs_*,
> > then it is probably doing something wrong.
> Do you mean use .groups of struct miscdevice directly ?
> If yes, let me follow drivers/char/hw_random/s390-trng.c to do this.
> BTW, few driver use the .groups directly. :)

Drivers should almost never be messing with individual sysfs files. And
this ability to use .groups is a "new" one, conversions of existing code
that do not use them is always welcome.


greg k-h

 \ /
  Last update: 2020-09-28 07:24    [W:0.075 / U:5.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site