kernel: split patches folder up into backport, pending and hack folders
[oweals/openwrt.git] / target / linux / generic / hack-4.9 / 904-debloat_dma_buf.patch
1 From e3692cb2fcd5ba1244512a0f43b8118f65f1c375 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Sat, 8 Jul 2017 08:20:43 +0200
4 Subject: debloat: dmabuf
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8  drivers/base/Kconfig      |  2 +-
9  drivers/dma-buf/Makefile  | 10 +++++++---
10  drivers/dma-buf/dma-buf.c |  4 +++-
11  kernel/sched/core.c       |  1 +
12  4 files changed, 12 insertions(+), 5 deletions(-)
13
14 diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
15 index d02e7c0f5bfd..e1c0e2e0d3a8 100644
16 --- a/drivers/base/Kconfig
17 +++ b/drivers/base/Kconfig
18 @@ -241,7 +241,7 @@ config SOC_BUS
19  source "drivers/base/regmap/Kconfig"
20  
21  config DMA_SHARED_BUFFER
22 -       bool
23 +       tristate
24         default n
25         select ANON_INODES
26         help
27 diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile
28 index 210a10bfad2b..36ee68dcdffe 100644
29 --- a/drivers/dma-buf/Makefile
30 +++ b/drivers/dma-buf/Makefile
31 @@ -1,3 +1,7 @@
32 -obj-y := dma-buf.o fence.o reservation.o seqno-fence.o fence-array.o
33 -obj-$(CONFIG_SYNC_FILE)                += sync_file.o
34 -obj-$(CONFIG_SW_SYNC)          += sw_sync.o sync_debug.o
35 +obj-$(CONFIG_DMA_SHARED_BUFFER) := dma-shared-buffer.o
36 +
37 +dma-buf-objs-y := dma-buf.o fence.o reservation.o seqno-fence.o fence-array.o
38 +dma-buf-objs-$(CONFIG_SYNC_FILE)               += sync_file.o
39 +dma-buf-objs-$(CONFIG_SW_SYNC)         += sw_sync.o sync_debug.o
40 +
41 +dma-shared-buffer-objs :=  $(dma-buf-objs-y)
42 diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
43 index 6b54e02da10c..24e69ef1f243 100644
44 --- a/drivers/dma-buf/dma-buf.c
45 +++ b/drivers/dma-buf/dma-buf.c
46 @@ -34,6 +34,7 @@
47  #include <linux/poll.h>
48  #include <linux/reservation.h>
49  #include <linux/mm.h>
50 +#include <linux/module.h>
51  
52  #include <uapi/linux/dma-buf.h>
53  
54 @@ -977,4 +978,5 @@ static void __exit dma_buf_deinit(void)
55  {
56         dma_buf_uninit_debugfs();
57  }
58 -__exitcall(dma_buf_deinit);
59 +module_exit(dma_buf_deinit);
60 +MODULE_LICENSE("GPL");
61 diff --git a/kernel/sched/core.c b/kernel/sched/core.c
62 index 692c948ae333..eaf379285cca 100644
63 --- a/kernel/sched/core.c
64 +++ b/kernel/sched/core.c
65 @@ -2170,6 +2170,7 @@ int wake_up_state(struct task_struct *p, unsigned int state)
66  {
67         return try_to_wake_up(p, state, 0);
68  }
69 +EXPORT_SYMBOL_GPL(wake_up_state);
70  
71  /*
72   * This function clears the sched_dl_entity static params.
73 -- 
74 2.11.0
75