Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

device_register(9) [centos man page]

DEVICE_REGISTER(9)					   Device drivers infrastructure					DEVICE_REGISTER(9)

NAME
device_register - register a device with the system. SYNOPSIS
int device_register(struct device * dev); ARGUMENTS
dev pointer to the device structure DESCRIPTION
This happens in two clean steps - initialize the device and add it to the system. The two steps can be called separately, but this is the easiest and most common. I.e. you should only call the two helpers separately if have a clearly defined need to use and refcount the device before it is added to the hierarchy. For more information, see the kerneldoc for device_initialize and device_add. NOTE
_Never_ directly free dev after calling this function, even if it returned an error! Always use put_device to give up the reference initialized in this function instead. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 DEVICE_REGISTER(9)

Check Out this Related Man Page

DEVICE_SCHEDULE_CALL(9) 				   Device drivers infrastructure				   DEVICE_SCHEDULE_CALL(9)

NAME
device_schedule_callback_owner - helper to schedule a callback for a device SYNOPSIS
int device_schedule_callback_owner(struct device * dev, void (*func) (struct device *), struct module * owner); ARGUMENTS
dev device. func callback function to invoke later. owner module owning the callback routine DESCRIPTION
Attribute methods must not unregister themselves or their parent device (which would amount to the same thing). Attempts to do so will deadlock, since unregistration is mutually exclusive with driver callbacks. Instead methods can call this routine, which will attempt to allocate and schedule a workqueue request to call back func with dev as its argument in the workqueue's process context. dev will be pinned until func returns. This routine is usually called via the inline device_schedule_callback, which automatically sets owner to THIS_MODULE. Returns 0 if the request was submitted, -ENOMEM if storage could not be allocated, -ENODEV if a reference to owner isn't available. NOTE
This routine won't work if CONFIG_SYSFS isn't set! It uses an underlying sysfs routine (since it is intended for use by attribute methods), and if sysfs isn't available you'll get nothing but -ENOSYS. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 DEVICE_SCHEDULE_CALL(9)
Man Page