summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-09-02 17:34:47 -0700
committerPhilippe Schenker <philippe.schenker@toradex.com>2020-08-13 16:04:38 +0200
commit5ca192b80990f2f93ac7c92e8876e4d275a143ed (patch)
tree290a5fe056ae86431147d0977711a9e55a4f286d /drivers/video
parent9a15cbba50716a88d54d4f07eeb2ac7587506b2a (diff)
video: mxsfb: simplify parsing
Use the timing count from the parsed struct display_timings instead of looping through the device tree again. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 65be28e2a2b3761d088b20c43994be97d74c342f) (cherry picked from commit fb1f7d3d72a392289b9d0b2b2f3a13ba52492aef)
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/mxsfb.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
index 3019759097fd..9d2c3165df58 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -1344,7 +1344,6 @@ static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host)
struct device *dev = &host->pdev->dev;
struct device_node *np = host->pdev->dev.of_node;
struct device_node *display_np;
- struct device_node *timings_np;
struct display_timings *timings = NULL;
const char *disp_dev, *disp_videomode;
struct videomode vm;
@@ -1415,23 +1414,16 @@ static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host)
goto put_display_node;
}
- timings_np = of_find_node_by_name(display_np,
- "display-timings");
- if (!timings_np) {
- dev_err(dev, "failed to find display-timings node\n");
- ret = -ENOENT;
- goto put_display_node;
- }
-
INIT_LIST_HEAD(&fb_info->modelist);
- for (i = 0; i < of_get_child_count(timings_np); i++) {
+ for (i = 0; i < timings->num_timings; i++) {
ret = videomode_from_timings(timings, &vm, i);
if (ret < 0)
- goto put_timings_node;
+ goto put_display_node;
+
ret = fb_videomode_from_videomode(&vm, &fb_vm);
if (ret < 0)
- goto put_timings_node;
+ goto put_display_node;
if (!(vm.flags & DISPLAY_FLAGS_DE_HIGH))
fb_vm.sync |= FB_SYNC_OE_LOW_ACT;
@@ -1462,8 +1454,6 @@ static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host)
/* save the sync value getting from dtb */
host->sync = fb_info->var.sync;
-put_timings_node:
- of_node_put(timings_np);
put_display_node:
if (timings)
kfree(timings);