Skip to content

Commit

Permalink
drm: panel-orientation-quirks: Convert to use match_string() helper
Browse files Browse the repository at this point in the history
The new helper returns index of the matching string in an array.
We are going to use it here.

Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
andy-shev authored and atseanpaul committed May 10, 2018
1 parent 2f065d8 commit 818c05d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/drm/drm_panel_orientation_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 818c05d

Please sign in to comment.