summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/dma-mapping.h14
-rw-r--r--include/asm-arm/hardware.h9
-rw-r--r--include/linux/device.h2
3 files changed, 15 insertions, 10 deletions
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index 542f5cff343b..1a0443794320 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -42,12 +42,12 @@ extern struct bus_type sa1111_bus_type;
/*
* Return whether the given device DMA address mask can be supported
* properly. For example, if your device can only drive the low 24-bits
- * during PCI bus mastering, then you would pass 0x00ffffff as the mask
+ * during bus mastering, then you would pass 0x00ffffff as the mask
* to this function.
*/
static inline int dma_supported(struct device *dev, u64 mask)
{
- return 1;
+ return dev->dma_mask && *dev->dma_mask != 0;
}
static inline int dma_set_mask(struct device *dev, u64 dma_mask)
@@ -81,14 +81,8 @@ static inline int dma_is_consistent(dma_addr_t handle)
* return the CPU-viewed address, and sets @handle to be the
* device-viewed address.
*/
-static inline void *
-dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp)
-{
- if (dev == NULL || dmadev_is_sa1111(dev) || *dev->dma_mask != 0xffffffff)
- gfp |= GFP_DMA;
-
- return consistent_alloc(gfp, size, handle, 0);
-}
+extern void *
+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp);
/**
* dma_free_coherent - free memory allocated by dma_alloc_coherent
diff --git a/include/asm-arm/hardware.h b/include/asm-arm/hardware.h
index 1fd1a5b6504b..0712491cfdc4 100644
--- a/include/asm-arm/hardware.h
+++ b/include/asm-arm/hardware.h
@@ -15,4 +15,13 @@
#include <asm/arch/hardware.h>
+#ifndef __ASSEMBLY__
+
+struct platform_device;
+
+extern int platform_add_devices(struct platform_device *, int);
+extern int platform_add_device(struct platform_device *);
+
+#endif
+
#endif
diff --git a/include/linux/device.h b/include/linux/device.h
index 8e3f1919d974..577ac546e48d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -385,6 +385,8 @@ struct platform_device {
struct resource * resource;
};
+#define to_platform_device(x) container_of((x), struct platform_device, dev)
+
extern int platform_device_register(struct platform_device *);
extern void platform_device_unregister(struct platform_device *);