mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
ODROID-COMMON: drm/hdmitx: fix check if 'display-timings' node exists
This patch is to prevent printing annoying kernel log '...could not find
display-timings node...' when a device tree does not contain the node.
drivers/video/of_display_timing.c:
struct display_timings *of_get_display_timings(const struct device_node *np)
{
...
timings_np = of_get_child_by_name(np, "display-timings");
if (!timings_np) {
pr_err("%pOF: could not find display-timings node\n", np);
return NULL;
}
}
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I2a034e83461f1be6831d8d89e923e376e6fe51ee
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <linux/of.h>
|
||||
|
||||
#include <video/of_display_timing.h>
|
||||
#include <video/videomode.h>
|
||||
|
||||
@@ -6,16 +8,26 @@
|
||||
int load_odroid_display_mode_from_dt(struct drm_connector *connector,
|
||||
struct device_node *node)
|
||||
{
|
||||
struct display_timings *disp = of_get_display_timings(node);
|
||||
struct display_timings *disp;
|
||||
struct device_node *timings_np;
|
||||
int i;
|
||||
int count = 0;
|
||||
|
||||
if (!node)
|
||||
return 0;
|
||||
|
||||
timings_np = of_get_child_by_name(node, "display-timings");
|
||||
if (!timings_np)
|
||||
return 0;
|
||||
|
||||
disp = of_get_display_timings(node);
|
||||
if (!disp)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < disp->num_timings; i++) {
|
||||
struct drm_display_mode mode;
|
||||
int ret;
|
||||
|
||||
ret = of_get_drm_display_mode(node, &mode, NULL, i);
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user