mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 03:06:58 +07:00
video: fbdev: pxafb: Convert to use match_string() helper
The new helper returns index of the matching string in an array. We are going to use it here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
This commit is contained in:
parent
598041f39f
commit
6d09dfe70f
@ -2099,7 +2099,7 @@ static void pxafb_check_options(struct device *dev, struct pxafb_mach_info *inf)
|
||||
|
||||
#if defined(CONFIG_OF)
|
||||
static const char * const lcd_types[] = {
|
||||
"unknown", "mono-stn", "mono-dstn", "color-stn", "color-dstn",
|
||||
"mono-stn", "mono-dstn", "color-stn", "color-dstn",
|
||||
"color-tft", "smart-panel", NULL
|
||||
};
|
||||
|
||||
@ -2115,12 +2115,10 @@ static int of_get_pxafb_display(struct device *dev, struct device_node *disp,
|
||||
if (ret)
|
||||
s = "color-tft";
|
||||
|
||||
for (i = 0; lcd_types[i]; i++)
|
||||
if (!strcmp(s, lcd_types[i]))
|
||||
break;
|
||||
if (!i || !lcd_types[i]) {
|
||||
i = match_string(lcd_types, -1, s);
|
||||
if (i < 0) {
|
||||
dev_err(dev, "lcd-type %s is unknown\n", s);
|
||||
return -EINVAL;
|
||||
return i;
|
||||
}
|
||||
info->lcd_conn |= LCD_CONN_TYPE(i);
|
||||
info->lcd_conn |= LCD_CONN_WIDTH(bus_width);
|
||||
|
Loading…
Reference in New Issue
Block a user