Re: sysfs entries for the character driver

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

 



On Thu, Jul 09, 2009 at 05:18:39PM +0530, arun c wrote:
> Hi,
> 
> 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?

Do so on the struct device that your bus type hands to you.

> 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/?

You could, if you wish to create a new class.  Odds are you should just
use the existing interfaces provided for this.

For a PCI device, use the PCI device structure passed to your probe
function.

thanks,

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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