drm/rockchip: add a safety mothed to restore logo file

we found the name value from the following function will
be null at rockchip_display_fixup(), so we instore this
value at display_state local parameter.
    ofnode_read_string_index(node, "logo,kernel", 0, &name))

Change-Id: I18c6b2a699cf8063d4b9e43b7627c388746dcff0
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
Sandy Huang 2018-08-17 11:02:23 +08:00 committed by Jianhong Chen
parent 747dfc263c
commit 54fc9addaa
2 changed files with 8 additions and 4 deletions

View File

@ -1351,8 +1351,12 @@ static int rockchip_display_probe(struct udevice *dev)
memset(s, 0, sizeof(*s));
INIT_LIST_HEAD(&s->head);
ret = ofnode_read_string_index(node, "logo,uboot", 0, &s->ulogo_name);
ret = ofnode_read_string_index(node, "logo,kernel", 0, &s->klogo_name);
ret = ofnode_read_string_index(node, "logo,uboot", 0, &name);
if (!ret)
memcpy(s->ulogo_name, name, strlen(name));
ret = ofnode_read_string_index(node, "logo,kernel", 0, &name);
if (!ret)
memcpy(s->klogo_name, name, strlen(name));
ret = ofnode_read_string_index(node, "logo,mode", 0, &name);
if (!strcmp(name, "fullscreen"))
s->logo_mode = ROCKCHIP_DISPLAY_FULLSCREEN;

View File

@ -154,8 +154,8 @@ struct display_state {
struct connector_state conn_state;
struct panel_state panel_state;
const char *ulogo_name;
const char *klogo_name;
char ulogo_name[30];
char klogo_name[30];
struct logo_info logo;
int logo_mode;