/* Check if the time is right and execute __pm_request_suspend() in that case.  */
static void pm_suspend_timer_fn(unsigned long data)
/* Check if the time is right and execute __pm_request_suspend() in that case.  */
static void pm_suspend_timer_fn(unsigned long data)
{
	struct device *dev = (struct device *)data;
	unsigned long flags;
	unsigned long expires;
	spin_lock_irqsave(&dev->power.lock, flags);
	expires = dev->power.timer_expires;
	if (expires > 0 && !time_after(expires, jiffies)) {
		dev->power.timer_expires = 0;
		__pm_request_suspend(dev);
	}
	spin_unlock_irqrestore(&dev->power.lock, flags);
}