Re: devfs_mk_cdev question

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

 



Where can I find this documentation?
----- Original Message ----- From: "Greg KH" <greg@xxxxxxxxx>
To: "Paul Akkermans" <paulakkermans@xxxxxxxxxx>
Cc: "kernel newbie" <kernelnewbies@xxxxxxxxxxxx>; <debian-user@xxxxxxxxxxxxxxxx>
Sent: Tuesday, December 07, 2004 6:13 PM
Subject: Re: devfs_mk_cdev question



On Tue, Dec 07, 2004 at 05:34:16PM +0100, Paul Akkermans wrote:
Can you also tell me what "class_simple_device_add() " does then?

To quote the documentation (why do I write it if no one even reads it...):

/**
* class_simple_device_add - adds a class device to sysfs for a character driver
* @cs: pointer to the struct class_simple that this device should be registered to.
* @dev: the dev_t for the device to be added.
* @device: a pointer to a struct device that is assiociated with this class device.
* @fmt: string for the class device's name
*
* This function can be used by simple char device classes that do not
* implement their own class device registration. A struct class_device will
* be created in sysfs, registered to the specified class. A "dev" file will
* be created, showing the dev_t for the device. The pointer to the struct
* class_device will be returned from the call. Any further sysfs files that
* might be required can be created using this pointer.
* Note: the struct class_simple passed to this function must have previously been
* created with a call to class_simple_create().
*/



Use this if you want to add sysfs (and hence, udev) support to your driver in a very easy manner. Also see class_simple_create() for some more documenataion.

thanks,

greg k-h

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/





-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: 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