Name

class_simple_device_add — adds a class device to sysfs for a character driver

Synopsis

struct class_device * class_simple_device_add (struct class_simple *  cs,
 dev_t  dev,
 struct device *  device,
 const char *  fmt,
   ...);

Arguments

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

...

variable arguments

Description

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.