/* Allocate and map the receive buffer, unless it is already allocated.  */
static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
/* Allocate and map the receive buffer, unless it is already allocated.  */
static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
{
	if (si->rxskb)
		return 0;
	si->rxskb = alloc_skb(HPSIR_MAX_RXLEN + 1, GFP_ATOMIC);
	if (!si->rxskb) {
		printk(KERN_ERR "sa1100_ir: out of memory for RX SKB\n");
		return -ENOMEM;
	}
	skb_reserve(si->rxskb, 1);
	si->rxbuf_dma = dma_map_single(si->dev, si->rxskb->data,
					HPSIR_MAX_RXLEN,
					DMA_FROM_DEVICE);
	return 0;
}