Sysfs - export sysfs_create_subdir?

Jonathan Cameron
2011-07-22T17:43:18Z

Hi All,

I have a couple of cases in IIO where under some conditions
we end up using dummy attr_groups (no elements) to initialize
a sub directory before dynamically creating all of its attributes.

Now having dummy groups in the IIO core is fine, but it does seem
a little messy.

The obvious choice would be to put together a small wrapper function
for sysfs_create_subdir that also does sysfs_get on the result.

Anyone have any strong feelings on whether this is worthwhile or not?

It'll save me about 16 lines of code, so not exactly a big point,
but nice to get it right none the less!

If there is a way of doing this cleanly that I'm missing, then sorry
for the noise and please tell me what it is!

Jonathan