The patch below makes the srpt driver compile against the 2.6.27 kernel
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 30 Oct 2008 12:34:48 +0000 (12:34 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 30 Oct 2008 12:34:48 +0000 (12:34 +0000)
headers.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Acked-by: Vu Pham <vu@mellanox.com>
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@551 d57e44dd-8a1f-0410-8b47-8ef2f437770f

srpt/src/ib_srpt.c

index d25d2c6..f534179 100644 (file)
@@ -425,7 +425,11 @@ static struct srpt_ioctx *srpt_alloc_ioctx(struct srpt_device *sdev)
 
        ioctx->dma = dma_map_single(sdev->device->dma_device, ioctx->buf,
                                    MAX_MESSAGE_SIZE, DMA_BIDIRECTIONAL);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+       if (dma_mapping_error(sdev->device->dma_device, ioctx->dma))
+#else
        if (dma_mapping_error(ioctx->dma))
+#endif
                goto out_free_buf;
 
        return ioctx;