a9498315256427c4751ca19d02c2a33cf5162172
[openwrt/staging/mans0n.git] /
1 From 8153056fa1d45394057017843070d3a366dbd918 Mon Sep 17 00:00:00 2001
2 From: "Andrew F. Davis" <afd@ti.com>
3 Date: Mon, 16 Dec 2019 08:34:04 -0500
4 Subject: [PATCH] dma-buf: heaps: Use _IOCTL_ for userspace IOCTL
5 identifier
6
7 Commit b3b4346544b571c96d46be615b9db69a601ce4c8 upstream.
8
9 This is more consistent with the DMA and DRM frameworks convention. This
10 patch is only a name change, no logic is changed.
11
12 Signed-off-by: Andrew F. Davis <afd@ti.com>
13 Acked-by: John Stultz <john.stultz@linaro.org>
14 Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
15 Link: https://patchwork.freedesktop.org/patch/msgid/20191216133405.1001-2-afd@ti.com
16 ---
17 drivers/dma-buf/dma-heap.c | 4 ++--
18 include/uapi/linux/dma-heap.h | 4 ++--
19 tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 2 +-
20 3 files changed, 5 insertions(+), 5 deletions(-)
21
22 --- a/drivers/dma-buf/dma-heap.c
23 +++ b/drivers/dma-buf/dma-heap.c
24 @@ -107,7 +107,7 @@ static long dma_heap_ioctl_allocate(stru
25 }
26
27 unsigned int dma_heap_ioctl_cmds[] = {
28 - DMA_HEAP_IOC_ALLOC,
29 + DMA_HEAP_IOCTL_ALLOC,
30 };
31
32 static long dma_heap_ioctl(struct file *file, unsigned int ucmd,
33 @@ -153,7 +153,7 @@ static long dma_heap_ioctl(struct file *
34 memset(kdata + in_size, 0, ksize - in_size);
35
36 switch (kcmd) {
37 - case DMA_HEAP_IOC_ALLOC:
38 + case DMA_HEAP_IOCTL_ALLOC:
39 ret = dma_heap_ioctl_allocate(file, kdata);
40 break;
41 default:
42 --- a/include/uapi/linux/dma-heap.h
43 +++ b/include/uapi/linux/dma-heap.h
44 @@ -42,12 +42,12 @@ struct dma_heap_allocation_data {
45 #define DMA_HEAP_IOC_MAGIC 'H'
46
47 /**
48 - * DOC: DMA_HEAP_IOC_ALLOC - allocate memory from pool
49 + * DOC: DMA_HEAP_IOCTL_ALLOC - allocate memory from pool
50 *
51 * Takes a dma_heap_allocation_data struct and returns it with the fd field
52 * populated with the dmabuf handle of the allocation.
53 */
54 -#define DMA_HEAP_IOC_ALLOC _IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\
55 +#define DMA_HEAP_IOCTL_ALLOC _IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\
56 struct dma_heap_allocation_data)
57
58 #endif /* _UAPI_LINUX_DMABUF_POOL_H */
59 --- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
60 +++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
61 @@ -116,7 +116,7 @@ static int dmabuf_heap_alloc_fdflags(int
62 if (!dmabuf_fd)
63 return -EINVAL;
64
65 - ret = ioctl(fd, DMA_HEAP_IOC_ALLOC, &data);
66 + ret = ioctl(fd, DMA_HEAP_IOCTL_ALLOC, &data);
67 if (ret < 0)
68 return ret;
69 *dmabuf_fd = (int)data.fd;