drm: panel-orientation-quirks: 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.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180503184119.22355-1-andriy.shevchenko@linux.intel.com
This commit is contained in:
Andy Shevchenko 2018-05-03 21:41:19 +03:00 committed by Sean Paul
parent 2f065d8ae9
commit 818c05d8e2
1 changed files with 3 additions and 4 deletions

View File

@ -172,10 +172,9 @@ int drm_get_panel_orientation_quirk(int width, int height)
if (!bios_date)
continue;
for (i = 0; data->bios_dates[i]; i++) {
if (!strcmp(data->bios_dates[i], bios_date))
return data->orientation;
}
i = match_string(data->bios_dates, -1, bios_date);
if (i >= 0)
return data->orientation;
}
return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;