Thanks for the inputs, That definitely sounds much simpler to deal with.But the Idea here is :Why this crazy set of different groups? You can set the mode of a sysfs
We ended up with providing different options like read-only,root-only to
nvmem providers combined with read/write callbacks.
With that, there are some cases which are totally invalid, existing code
does very minimal check to ensure that before populating with correct
attributes to sysfs file. One of such case is with thunderbolt provider
which supports only write callback.
With this new checks in place these flags and callbacks are correctly
validated, would result in correct file attributes.
file in the callback for when the file is about to be created, that's so
much simpler and is what it is for. This feels really hacky and almost
impossible to follow:(
thanks,
greg k-h