From 6e4a76291ebd5c61dcaa8281cefe0bd2d883c1fd Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 20 Apr 2012 10:56:11 +0000 Subject: [PATCH] caif: include linux/io.h The caif_shmcore requires io.h in order to use ioremap, so include that explicitly to compile in all configurations. Also add a note about the use of ioremap(), which is not a proper way to map a DMA buffer into kernel space. It's not completely clear what the intention is for using ioremap, but it is clear that the result of ioremap must not simply be accessed using kernel pointers but should use readl/writel or memcopy_{to,from}io. Assigning the result of ioremap to a regular pointer that can also be set to something else is not ok. Signed-off-by: Arnd Bergmann Signed-off-by: Mathieu Poirier Signed-off-by: David S. Miller --- drivers/net/caif/caif_shmcore.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c index 5b20413..bc497d7 100644 --- a/drivers/net/caif/caif_shmcore.c +++ b/drivers/net/caif/caif_shmcore.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -647,6 +648,9 @@ int caif_shmcore_probe(struct shmdev_layer *pshm_dev) if (pshm_dev->shm_loopback) tx_buf->desc_vptr = (unsigned char *)tx_buf->phy_addr; else + /* + * FIXME: the result of ioremap is not a pointer - arnd + */ tx_buf->desc_vptr = ioremap(tx_buf->phy_addr, TX_BUF_SZ); -- 2.7.4