summaryrefslogtreecommitdiff
path: root/fblog/0010-fblog-add-activate-module-parameter.patch
blob: fcdc0c75d45829b889f5bd24187d7b8f8518ec41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 308643219b3ec4cb8c772459af6330d06d8bda82 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@googlemail.com>
Date: Sat, 16 Jun 2012 23:31:18 +0200
Subject: [PATCH 10/10] fblog: add "activate" module parameter

This new parameter controls whether fblog is automatically activated when
it is loaded. This defaults to "true".

We can now compile with CONFIG_VT=n and CONFIG_FBLOG=y and control fblog
with fblog.activate=0/1 on the kernel command line to enable/disable
debugging.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 drivers/video/console/fblog.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/video/console/fblog.c b/drivers/video/console/fblog.c
index 9d3b072..cabc550 100644
--- a/drivers/video/console/fblog.c
+++ b/drivers/video/console/fblog.c
@@ -94,6 +94,7 @@ struct fblog_fb {
 static struct fblog_fb *fblog_fbs[FB_MAX];
 static struct device *fblog_device;
 static atomic_t fblog_active;
+static bool activate = 1;
 
 static void fblog_buf_resize(struct fblog_buf *buf, size_t width,
 			     size_t height)
@@ -653,6 +654,12 @@ static int __init fblog_init(void)
 
 	register_console(&fblog_con_driver);
 
+	if (activate) {
+		console_lock();
+		fblog_activate();
+		console_unlock();
+	}
+
 	return 0;
 
 err_fb:
@@ -677,6 +684,9 @@ static void __exit fblog_exit(void)
 	put_device(fblog_device);
 }
 
+module_param(activate, bool, S_IRUGO);
+MODULE_PARM_DESC(activate, "Activate fblog by default");
+
 module_init(fblog_init);
 module_exit(fblog_exit);
 MODULE_LICENSE("GPL");
-- 
1.7.10.4