summaryrefslogtreecommitdiff
path: root/drivers/staging/panel/panel.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-02-11 16:57:08 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-06 16:31:58 -0800
commit733345ec4ee3756822d455fc809f40713975bf76 (patch)
tree66cfb5d0693f3c47019916422ffd322f398410a9 /drivers/staging/panel/panel.c
parentf43de77c9dddba86284f7cb58c5e257ebed843a3 (diff)
staging: panel: initialize lcd if lcd enabled
initialiaze lcd parameters only if lcd is enabled. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/panel/panel.c')
-rw-r--r--drivers/staging/panel/panel.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 322b73d265d6..3339633e88d3 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -2321,25 +2321,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),
@@ -2359,6 +2340,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;