Re: sysfs entries for the character driver

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

 





On Fri, Jul 17, 2009 at 1:45 PM, Daniel Baluta <daniel.baluta@xxxxxxxxx> wrote:
Hello,

> I want to create sysfs entries for my character device
> in order to manipulate (show, store) the device parameters.
>
> I am registering the character driver by
> alloc_chrdev_region + cdev_init + cdev_add.
>
> what is the preferred method to create sysfs
> entries for the new character device?
>
> The hardware for which I am  writing driver is like this
> Its is a PCI card with 4 or 2 CAN devices(depending
> on the board varient) on it. /dev/canN will be the
> dev node for the devices
>
> My doubt is whether I have to create sysfs entries
> in the folder  /sys/bus/pci/devices/XXXX or
> use class_create() + device_create() and then
> create the entries in the folder /sys/class/my_new_class/?

After all, what decisions did you take?
How does your sysfs entries look like?

I decided to create new class in sysfs so the device
details will come in /sys/class/xxxx/xxx. This will
expose the dev_t(major and minor) to the user.
As i am not planning for mainline submission
i think this won't be a problem.

And all the hardware specific details will be
exposed through the pci_dev structure.

Arun C

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux