summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-09-02 17:34:47 -0700
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-12-24 01:27:34 +0100
commit0ee389f293b59bb475ac811ec308a33d3ade1034 (patch)
treee4004af06ba7743c052a01651b587479bef2a208
parent3df4eef3dcbc9926b11c327c25ebbd717674e1f0 (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)
-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 71ea8df544f1..927a85577a55 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -1343,7 +1343,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;
@@ -1414,23 +1413,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;
@@ -1461,8 +1453,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);