4

How it is possible to get a kobject for, say, a path of /sys/devices, for use as parent kobject for your own sysfs entry ?

Alexander Tumin
  • 1,561
  • 4
  • 22
  • 33

1 Answers1

4

The proper way to place you entry in such folders - through the public interface of the subsystem.

In order to place your entry in /sys/devices you should call device_register(). The kset for /sys/devices is devices_kset declared in drivers/base/base.h and defined in drivers/base/core.c. It is not an exported symbol. That's why you can't access it in module, but can freely manipulate it inside the kernel.

Alexey Shmalko
  • 3,678
  • 1
  • 19
  • 35