/* meson_spifc_drain_buffer() - copy data from device buffer to memory @spifc: the Meson SPI device @buf: the destination buffer @len: number of bytes to copy  */
static void meson_spifc_drain_buffer(struct meson_spifc_priv *spifc, u8 *buf, int len)
/* meson_spifc_drain_buffer() - copy data from device buffer to memory @spifc: the Meson SPI device @buf: the destination buffer @len: number of bytes to copy  */
static void meson_spifc_drain_buffer(struct meson_spifc_priv *spifc, u8 *buf, int len)
{
	u32 data;
	int i = 0;
	while (i < len) {
		regmap_read(spifc->regmap, REG_C0 + i, &data);
		if (len - i >= 4) {
			*((u32 *)buf) = data;
			buf += 4;
		} else {
			memcpy(buf, &data, len - i);
			break;
		}
		i += 4;
	}
}