summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-05-15 12:41:10 +0200
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-05-15 12:41:10 +0200
commit6d09dfe70f8f36843d8152592d7d80aa909e9c9d (patch)
tree4f8abd9e3a4f7d8149ef716938360043f6adb24f /drivers/video
parent598041f39f3b2c0327a44d8289d27bac35fe7b6a (diff)
downloadlinux-6d09dfe70f8f36843d8152592d7d80aa909e9c9d.tar.gz
linux-6d09dfe70f8f36843d8152592d7d80aa909e9c9d.tar.bz2
linux-6d09dfe70f8f36843d8152592d7d80aa909e9c9d.zip
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/pxafb.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index c3d49e13643c..0c013f1efe81 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -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);