/* Scheduled procedure to handle blocking stuff for the pushbuttons. Handles all pending events and exits.  */
static void shpchp_pushbutton_thread(struct work_struct *work)
/* Scheduled procedure to handle blocking stuff for the pushbuttons. Handles all pending events and exits.  */
static void shpchp_pushbutton_thread(struct work_struct *work)
{
	struct pushbutton_work_info *info =
		container_of(work, struct pushbutton_work_info, work);
	struct slot *p_slot = info->p_slot;
	mutex_lock(&p_slot->lock);
	switch (p_slot->state) {
	case POWEROFF_STATE:
		mutex_unlock(&p_slot->lock);
		shpchp_disable_slot(p_slot);
		mutex_lock(&p_slot->lock);
		p_slot->state = STATIC_STATE;
		break;
	case POWERON_STATE:
		mutex_unlock(&p_slot->lock);
		if (shpchp_enable_slot(p_slot))
			p_slot->hpc_ops->green_led_off(p_slot);
		mutex_lock(&p_slot->lock);
		p_slot->state = STATIC_STATE;
		break;
	default:
		break;
	}
	mutex_unlock(&p_slot->lock);
	kfree(info);
}