/* Functions prefixed with "h_" are protocol callbacks. They can be called from interrupt context. Return value of 0 means that request processing is still ongoing, while special error value of -EAGAIN means that current request is finished (and request processor should come back some time later).  */
static int h_memstick_read_dev_id(struct memstick_dev *card, struct memstick_request **mrq)
/* Functions prefixed with "h_" are protocol callbacks. They can be called from interrupt context. Return value of 0 means that request processing is still ongoing, while special error value of -EAGAIN means that current request is finished (and request processor should come back some time later).  */
static int h_memstick_read_dev_id(struct memstick_dev *card, struct memstick_request **mrq)
{
	struct ms_id_register id_reg;
	if (!(*mrq)) {
		memstick_init_req(&card->current_mrq, MS_TPC_READ_REG, NULL,
				  sizeof(struct ms_id_register));
		*mrq = &card->current_mrq;
		return 0;
	} else {
		if (!(*mrq)->error) {
			memcpy(&id_reg, (*mrq)->data, sizeof(id_reg));
			card->id.match_flags = MEMSTICK_MATCH_ALL;
			card->id.type = id_reg.type;
			card->id.category = id_reg.category;
			card->id.class = id_reg.class;
			dev_dbg(&card->dev, "if_mode = %02x\n", id_reg.if_mode);
		}
		complete(&card->mrq_complete);
		return -EAGAIN;
	}
}