diff mbox

[v1] video: fbdev: pxafb: Convert to use match_string() helper

Message ID 20180503180423.21710-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Shevchenko May 3, 2018, 6:04 p.m. UTC
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>
---
 drivers/video/fbdev/pxafb.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Bartlomiej Zolnierkiewicz May 15, 2018, 10:37 a.m. UTC | #1
On Thursday, May 03, 2018 09:04:23 PM Andy Shevchenko wrote:
> 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>

Patch queued for 4.18, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Shevchenko May 15, 2018, 11:35 a.m. UTC | #2
On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Thursday, May 03, 2018 09:04:23 PM Andy Shevchenko wrote:
> > 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>
> 
> Patch queued for 4.18, thanks.

I went through it again and found a bug, the type "unknown" should be
left untouched.
Bartlomiej Zolnierkiewicz May 15, 2018, 11:54 a.m. UTC | #3
On Tuesday, May 15, 2018 02:35:03 PM Andy Shevchenko wrote:
> On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Thursday, May 03, 2018 09:04:23 PM Andy Shevchenko wrote:
> > > 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>
> > 
> > Patch queued for 4.18, thanks.
> 
> I went through it again and found a bug, the type "unknown" should be
> left untouched.

Indeed, could you provide incremental fix?

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Shevchenko May 15, 2018, 11:59 a.m. UTC | #4
On Tue, 2018-05-15 at 13:54 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Tuesday, May 15, 2018 02:35:03 PM Andy Shevchenko wrote:
> > On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> > > On Thursday, May 03, 2018 09:04:23 PM Andy Shevchenko wrote:
> > > > 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.co
> > > > m>
> > > 
> > > Patch queued for 4.18, thanks.
> > 
> > I went through it again and found a bug, the type "unknown" should
> > be
> > left untouched.
> 
> Indeed, could you provide incremental fix?

Is it late enough to drop patch completely? If so, I do a fix asap.
Bartlomiej Zolnierkiewicz May 15, 2018, 12:17 p.m. UTC | #5
On Tuesday, May 15, 2018 02:59:20 PM Andy Shevchenko wrote:
> On Tue, 2018-05-15 at 13:54 +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Tuesday, May 15, 2018 02:35:03 PM Andy Shevchenko wrote:
> > > On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> > > > On Thursday, May 03, 2018 09:04:23 PM Andy Shevchenko wrote:
> > > > > 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.co
> > > > > m>
> > > > 
> > > > Patch queued for 4.18, thanks.
> > > 
> > > I went through it again and found a bug, the type "unknown" should
> > > be
> > > left untouched.
> > 
> > Indeed, could you provide incremental fix?
> 
> Is it late enough to drop patch completely? If so, I do a fix asap.

It is already merged in publicly available tree (which is not being
rebased) so it is too late to drop it completely.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);