Re: Sysfs - export sysfs_create_subdir?

Greg KH
2011-07-24T03:21:45Z

On Fri, Jul 22, 2011 at 06:43:13PM +0100, Jonathan Cameron wrote:
> 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.

Ick, you really shouldn't do that.

> 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.

That's why that function is not exported. Creating subdirectories in
sysfs is not a good idea, udev doesn't like it, and you don't get
userspace notification for it very well either.

What specifically are you trying to do in sysfs that you are needing
this?

thanks,

greg k-h