An error occurred while fetching folder content.
ptp: ocp: change sysfs attr group handling
Jonathan Lemon authored
In the detach path, the driver calls sysfs_remove_group() for the
groups it believes has been registered.  However, if the group was
never previously registered, then this causes a splat.

Instead, compute the groups that should be registered in advance,
and then call sysfs_create_groups(), which registers them all at once.

Update the error handling appropriately.

Fixes: c205d53c

 ("ptp: ocp: Add firmware capability bits for feature gating")
Reported-by: default avatarZheyu Ma <zheyuma97@gmail.com>
Signed-off-by: default avatarJonathan Lemon <jonathan.lemon@gmail.com>
Link: https://lore.kernel.org/r/20220517214600.10606-1-jonathan.lemon@gmail.com

Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
c2239294
Name Last commit Last update