diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-09-30 15:25:17 +0200 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2015-07-01 13:35:22 +0200 |
commit | 201b367e07efc326fca10e6276f08ee973437b28 (patch) | |
tree | 9e8b838708c3b93fb21a21543b620f97a8aece34 | |
parent | f729bf405bc94eb86141351f97a3e40fcf4cb25d (diff) |
video: fsl-dcu-fb: use num_timings to iterate timings
Use num_timings when iterating through available timings. This
saves getting the display-timings node again.
-rw-r--r-- | drivers/video/fbdev/fsl-dcu-fb.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/video/fbdev/fsl-dcu-fb.c b/drivers/video/fbdev/fsl-dcu-fb.c index 6b45357a50f0..23b16ee7775f 100644 --- a/drivers/video/fbdev/fsl-dcu-fb.c +++ b/drivers/video/fbdev/fsl-dcu-fb.c @@ -768,7 +768,6 @@ static int fsl_dcu_init_fbinfo(struct fb_info *info) struct dcu_fb_data *dcufb = mfbi->parent; struct device_node *np = dcufb->dev->of_node; struct device_node *display_np; - struct device_node *timings_np; struct display_timings *timings; int i; int ret = 0; @@ -793,32 +792,21 @@ static int fsl_dcu_init_fbinfo(struct fb_info *info) goto put_display_node; } - timings_np = of_find_node_by_name(display_np, - "display-timings"); - if (!timings_np) { - dev_err(dcufb->dev, "failed to find display-timings node\n"); - ret = -ENOENT; - goto put_display_node; - } - - for (i = 0; i < of_get_child_count(timings_np); i++) { + for (i = 0; i < timings->num_timings; i++) { struct videomode vm; struct fb_videomode fb_vm; 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; fb_add_videomode(&fb_vm, &info->modelist); } - return 0; -put_timings_node: - of_node_put(timings_np); put_display_node: of_node_put(display_np); return ret; |