* [PATCH] Add dma_zalloc_coherent to fix build with kernels older than 3.2
@ 2012-01-16 5:07 Nikolay Martynov
2012-01-16 23:35 ` Luis R. Rodriguez
0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Martynov @ 2012-01-16 5:07 UTC (permalink / raw)
To: mcgrof; +Cc: linux-wireless, Nikolay Martynov
Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
---
include/linux/compat-3.2.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h
index fb9ef68..a17c4ad 100644
--- a/include/linux/compat-3.2.h
+++ b/include/linux/compat-3.2.h
@@ -64,6 +64,15 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
module_driver(__platform_driver, platform_driver_register, \
platform_driver_unregister)
+static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
+ dma_addr_t *dma_handle, gfp_t flag)
+{
+ void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
+ if (ret)
+ memset(ret, 0, size);
+ return ret;
+}
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */
#endif /* LINUX_3_2_COMPAT_H */
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Add dma_zalloc_coherent to fix build with kernels older than 3.2
2012-01-16 5:07 [PATCH] Add dma_zalloc_coherent to fix build with kernels older than 3.2 Nikolay Martynov
@ 2012-01-16 23:35 ` Luis R. Rodriguez
0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2012-01-16 23:35 UTC (permalink / raw)
To: Nikolay Martynov; +Cc: linux-wireless
On Mon, Jan 16, 2012 at 12:07:55AM -0500, Nikolay Martynov wrote:
>
> Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Applied and pushed, thanks!
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-16 23:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16 5:07 [PATCH] Add dma_zalloc_coherent to fix build with kernels older than 3.2 Nikolay Martynov
2012-01-16 23:35 ` Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).