kernel: update kernel 4.9 to version 4.9.91
[openwrt/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 --- a/drivers/base/Kconfig
15 +++ b/drivers/base/Kconfig
16 @@ -244,7 +244,7 @@ config SOC_BUS
17 source "drivers/base/regmap/Kconfig"
18
19 config DMA_SHARED_BUFFER
20 - bool
21 + tristate
22 default n
23 select ANON_INODES
24 help
25 --- a/drivers/dma-buf/Makefile
26 +++ b/drivers/dma-buf/Makefile
27 @@ -1,3 +1,7 @@
28 -obj-y := dma-buf.o fence.o reservation.o seqno-fence.o fence-array.o
29 -obj-$(CONFIG_SYNC_FILE) += sync_file.o
30 -obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
31 +obj-$(CONFIG_DMA_SHARED_BUFFER) := dma-shared-buffer.o
32 +
33 +dma-buf-objs-y := dma-buf.o fence.o reservation.o seqno-fence.o fence-array.o
34 +dma-buf-objs-$(CONFIG_SYNC_FILE) += sync_file.o
35 +dma-buf-objs-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
36 +
37 +dma-shared-buffer-objs := $(dma-buf-objs-y)
38 --- a/drivers/dma-buf/dma-buf.c
39 +++ b/drivers/dma-buf/dma-buf.c
40 @@ -34,6 +34,7 @@
41 #include <linux/poll.h>
42 #include <linux/reservation.h>
43 #include <linux/mm.h>
44 +#include <linux/module.h>
45
46 #include <uapi/linux/dma-buf.h>
47
48 @@ -977,4 +978,5 @@ static void __exit dma_buf_deinit(void)
49 {
50 dma_buf_uninit_debugfs();
51 }
52 -__exitcall(dma_buf_deinit);
53 +module_exit(dma_buf_deinit);
54 +MODULE_LICENSE("GPL");
55 --- a/kernel/sched/core.c
56 +++ b/kernel/sched/core.c
57 @@ -2171,6 +2171,7 @@ int wake_up_state(struct task_struct *p,
58 {
59 return try_to_wake_up(p, state, 0);
60 }
61 +EXPORT_SYMBOL_GPL(wake_up_state);
62
63 /*
64 * This function clears the sched_dl_entity static params.