diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index 5df41f6f2b86..53427a734d4b 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c @@ -610,10 +610,8 @@ int fb_find_mode(struct fb_var_screeninfo *var, diff = refresh; best = -1; for (i = 0; i < dbsize; i++) { - if ((name_matches(db[i], name, namelen) && - !fb_try_mode(var, info, &db[i], bpp))) - return 1; - if (res_specified && res_matches(db[i], xres, yres)) { + if (name_matches(db[i], name, namelen) || + (res_specified && res_matches(db[i], xres, yres))) { if(!fb_try_mode(var, info, &db[i], bpp)) { if(!refresh_specified || db[i].refresh == refresh) return 1;