* [PATCH v2] staging: panel: initialize lcd if lcd enabled
@ 2015-02-11 11:27 Sudip Mukherjee
0 siblings, 0 replies; only message in thread
From: Sudip Mukherjee @ 2015-02-11 11:27 UTC (permalink / raw)
To: Willy Tarreau, Greg Kroah-Hartman; +Cc: Sudip Mukherjee, devel, linux-kernel
initialiaze lcd parameters only if lcd is enabled.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
v2: fix indention of comment
drivers/staging/panel/panel.c | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 6ed35b6..31d8608 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -2323,25 +2323,6 @@ static int __init panel_init_module(void)
break;
}
- /*
- * Init lcd struct with load-time values to preserve exact current
- * functionality (at least for now).
- */
- lcd.height = lcd_height;
- lcd.width = lcd_width;
- lcd.bwidth = lcd_bwidth;
- lcd.hwidth = lcd_hwidth;
- lcd.charset = lcd_charset;
- lcd.proto = lcd_proto;
- lcd.pins.e = lcd_e_pin;
- lcd.pins.rs = lcd_rs_pin;
- lcd.pins.rw = lcd_rw_pin;
- lcd.pins.cl = lcd_cl_pin;
- lcd.pins.da = lcd_da_pin;
- lcd.pins.bl = lcd_bl_pin;
-
- /* Leave it for now, just in case */
- lcd.esc_seq.len = -1;
/*
* Overwrite selection with module param values (both keypad and lcd),
@@ -2361,6 +2342,28 @@ static int __init panel_init_module(void)
lcd.enabled = (selected_lcd_type > 0);
+ if (lcd.enabled) {
+ /*
+ * Init lcd struct with load-time values to preserve exact
+ * current functionality (at least for now).
+ */
+ lcd.height = lcd_height;
+ lcd.width = lcd_width;
+ lcd.bwidth = lcd_bwidth;
+ lcd.hwidth = lcd_hwidth;
+ lcd.charset = lcd_charset;
+ lcd.proto = lcd_proto;
+ lcd.pins.e = lcd_e_pin;
+ lcd.pins.rs = lcd_rs_pin;
+ lcd.pins.rw = lcd_rw_pin;
+ lcd.pins.cl = lcd_cl_pin;
+ lcd.pins.da = lcd_da_pin;
+ lcd.pins.bl = lcd_bl_pin;
+
+ /* Leave it for now, just in case */
+ lcd.esc_seq.len = -1;
+ }
+
switch (selected_keypad_type) {
case KEYPAD_TYPE_OLD:
keypad_profile = old_keypad_profile;
--
1.8.1.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-02-11 11:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-11 11:27 [PATCH v2] staging: panel: initialize lcd if lcd enabled Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®