/* This helper will allocate a kmalloced buffer and use it to transmit (then free it). Reason for this is that the SDIO host controller expects alignment (unknown exactly which) which the stack won't really provide and certain arches/host-controller combinations cannot use stack/vmalloc/text areas for DMA transfers.  */
static int __i2400ms_send_barker(struct i2400ms *i2400ms, const __le32 *barker, size_t barker_size)
/* This helper will allocate a kmalloced buffer and use it to transmit (then free it). Reason for this is that the SDIO host controller expects alignment (unknown exactly which) which the stack won't really provide and certain arches/host-controller combinations cannot use stack/vmalloc/text areas for DMA transfers.  */
static int __i2400ms_send_barker(struct i2400ms *i2400ms, const __le32 *barker, size_t barker_size)
{
	int  ret;
	struct sdio_func *func = i2400ms->func;
	struct device *dev = &func->dev;
	void *buffer;
	ret = -ENOMEM;
	buffer = kmalloc(I2400MS_BLK_SIZE, GFP_KERNEL);
	if (buffer == NULL)
		goto error_kzalloc;
	memcpy(buffer, barker, barker_size);
	sdio_claim_host(func);
	ret = sdio_memcpy_toio(func, 0, buffer, I2400MS_BLK_SIZE);
	sdio_release_host(func);
	if (ret < 0)
		d_printf(0, dev, "E: barker error: %d\n", ret);
	kfree(buffer);
error_kzalloc:
	return ret;
}