/* For SD8385/SD8686, this function reads firmware status after the image is downloaded, or reads RX packet length when interrupt (with IF_SDIO_H_INT_UPLD bit set) is received. For SD8688, this function reads firmware status only.  */
static u16 if_sdio_read_scratch(struct if_sdio_card *card, int *err)
/* For SD8385/SD8686, this function reads firmware status after the image is downloaded, or reads RX packet length when interrupt (with IF_SDIO_H_INT_UPLD bit set) is received. For SD8688, this function reads firmware status only.  */
static u16 if_sdio_read_scratch(struct if_sdio_card *card, int *err)
{
	int ret;
	u16 scratch;
	scratch = sdio_readb(card->func, card->scratch_reg, &ret);
	if (!ret)
		scratch |= sdio_readb(card->func, card->scratch_reg + 1,
					&ret) << 8;
	if (err)
		*err = ret;
	if (ret)
		return 0xffff;
	return scratch;
}