Re: [PATCH v2] usb: typec: altmodes/displayport: create sysfs nodes after assigning driver data
From: RD Babiera
Date: Wed Feb 28 2024 - 18:03:22 EST
On Mon, Feb 26, 2024 at 9:20 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> Now I am going to push back again and ask why you are even attempting to
> create sysfs files "by hand" here at all?
>
> Why is this just not set to be a default group? That way the group is
> managed properly by the driver core and the driver doesn't have to worry
> about ANY of this at all. Bonus is that you remove the "you raced with
> userspace and lost" problem that this code still has even with the
> change you made here.
To answer both questions, the driver had always created its sysfs
nodes manually so I did not suspect this was not the preferred way
to handle driver sysfs creation until I found your article on default attributes
after your email. Will fix the patch up.
thanks again,
rd