Re: kobject question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 28, 2013 at 08:46:58PM -0500, H Hartley Sweeten wrote:
> Greg,
> 
> I'm trying to create a simple directory in the sysfs hierarchy following
> Documentation/kobject.txt and samples/kobject-example.c.

Hint, don't :)

> I have been able to create the subdirectory and attributes but now
> I'm stuck.

You really don't want to do this, trust me :)

> In the sample, the attribute files all use static data (foo, baz, bar).
> Is there any way to pass a pointer to the data needed by the
> attributes when using kobject_create_and_add()?

What do you mean by this?  You should be getting a callback with your
kobject in it, so that you can then dig out the needed information to
fill in the show/store data.

But let's take a step back, what are you trying to do by creating a new
sysfs directory?  You should never create a subdir in the device tree in
sysfs, that is not a 'struct device'.  That is because udev / userspace
will not see the directory, so any attribute under it will not be
accessable by the tools that users use to access them.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux