static int sirf_wait_for_power_state_nowakeup()

in sirf.c [205:228]


static int sirf_wait_for_power_state_nowakeup(struct sirf_data *data,
						bool active,
						unsigned long timeout)
{
	int ret;

	/* Wait for state change (including any shutdown messages). */
	msleep(timeout);

	/* Wait for data reception or timeout. */
	data->active = false;
	ret = wait_event_interruptible_timeout(data->power_wait,
			data->active, msecs_to_jiffies(SIRF_REPORT_CYCLE));
	if (ret < 0)
		return ret;

	if (ret > 0 && !active)
		return -ETIMEDOUT;

	if (ret == 0 && active)
		return -ETIMEDOUT;

	return 0;
}