lcd: fix driver version null pointer mistake
authorEvoke Zhang <evoke.zhang@amlogic.com>
Mon, 16 Jul 2018 07:00:04 +0000 (15:00 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Tue, 17 Jul 2018 03:30:35 +0000 (20:30 -0700)
PD#170130: lcd: fix driver version null pointer mistake

Change-Id: Ic3589a8261f57c3eb7a231b5fb778f2421601abe
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c
drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c
drivers/amlogic/media/vout/lcd/lcd_vout.c
include/linux/amlogic/media/vout/lcd/lcd_vout.h

index 8c37895b9c93b49e1b0759b40b264eb51be46461..b2e2cbc8b26a2abdd254864ea1714a55a6b907a4 100644 (file)
@@ -1285,7 +1285,6 @@ int lcd_tablet_probe(struct device *dev)
        struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver();
        int ret;
 
-       lcd_drv->version = LCD_DRV_VERSION;
        lcd_drv->driver_init_pre = lcd_tablet_driver_init_pre;
        lcd_drv->driver_disable_post = lcd_tablet_driver_disable_post;
        lcd_drv->driver_init = lcd_tablet_driver_init;
index d8f1a4b80937a0c57b16ff8b274c125134554b86..a357a3007181ec5db07938af6b6edc21005c5830 100644 (file)
@@ -1393,7 +1393,6 @@ int lcd_tv_probe(struct device *dev)
        int ret;
 
        memset(lcd_output_name, 0, sizeof(lcd_output_name));
-       lcd_drv->version = LCD_DRV_VERSION;
        lcd_drv->driver_init_pre = lcd_tv_driver_init_pre;
        lcd_drv->driver_disable_post = lcd_tv_driver_disable_post;
        lcd_drv->driver_init = lcd_tv_driver_init;
index 6d6a783975c73d02a8ee06f94b62f373c6191945..860c2d53610940e019526b78d9306cdae3082df0 100644 (file)
@@ -1022,6 +1022,7 @@ static int lcd_probe(struct platform_device *pdev)
                return -1;
        }
        lcd_driver->data = (struct lcd_data_s *)match->data;
+       strcpy(lcd_driver->version, LCD_DRV_VERSION);
        LCDPR("driver version: %s(%d-%s)\n",
                lcd_driver->version,
                lcd_driver->data->chip_type,
index 2ab2e5df0846bdf35f1616302339ca819b6c5be2..d868980bcccd426d481f7c54ac92953fca98a5c5 100644 (file)
@@ -393,7 +393,7 @@ struct lcd_duration_s {
 #define LCD_STATUS_ON         (LCD_STATUS_IF_ON | LCD_STATUS_ENCL_ON)
 
 struct aml_lcd_drv_s {
-       char *version;
+       char version[20];
        struct lcd_data_s *data;
        unsigned char lcd_mode;
        unsigned char lcd_status;