kernels/linux-2.4.0/kernel/pm.c
/**
 *	pm_register - register a device with power management
 *	@type: device type 
 *	@id: device ID
 *	@callback: callback function
 *
 *	Add a device to the list of devices that wish to be notified about
 *	power management events. A &pm_dev structure is returned on success,
 *	on failure the return is %NULL.
 */
register a device with power management
@type: device type
@id: device ID
@callback: callback function

Add a device to the list of devices that wish to be notified about
power management events. A ±_dev structure is returned on success,
on failure the return is %NULL.
register a device with power management @type : device type @id : device ID @callback : callback function Add a device to the list of devices that wish to be notified about power management events . A ±_dev structure is returned on success on failure the return is %NULL .
struct pm_dev *pm_register(pm_dev_t type,
			   unsigned long id,
			   pm_callback callback)
{
	struct pm_dev *dev = kmalloc(sizeof(struct pm_dev), GFP_KERNEL);
	if (dev) {
		unsigned long flags;
		memset(dev, 0, sizeof(*dev));
		dev->type = type;
		dev->id = id;
		dev->callback = callback;
		spin_lock_irqsave(&pm_devs_lock, flags);
		list_add(&dev->entry, &pm_devs);
		spin_unlock_irqrestore(&pm_devs_lock, flags);
	}
	return dev;
}
struct pm_dev * pm_register ( pm_dev_t type , unsigned long id , pm_callback callback ) { struct pm_dev * dev = kmalloc ( sizeof ( struct pm_dev ) , GFP_KERNEL ) ; if ( dev ) { unsigned long flags ; memset ( dev , 0 , sizeof ( * dev ) ) ; dev -> type = type ; dev -> id = id ; dev -> callback = callback ; spin_lock_irqsave ( & pm_devs_lock , flags ) ; list_add ( & dev -> entry , & pm_devs ) ; spin_unlock_irqrestore ( & pm_devs_lock , flags ) ; } return dev ; }
pm_register - register a device with power management
      @type: device type
      @id: device ID
      @callback: callback function
pm_register - register a device with power management @type : device type @id : device ID @callback : callback function