hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/video/of_display_timing.c
....@@ -1,11 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * OF helpers for parsing display timings
34 *
45 * Copyright (c) 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>, Pengutronix
56 *
67 * based on of_videomode.c by Sascha Hauer <s.hauer@pengutronix.de>
7
- *
8
- * This file is released under the GPLv2
98 */
109 #include <linux/export.h>
1110 #include <linux/of.h>
....@@ -120,17 +119,20 @@
120119 struct display_timing *dt)
121120 {
122121 struct device_node *timing_np;
122
+ int ret;
123123
124124 if (!np)
125125 return -EINVAL;
126126
127127 timing_np = of_get_child_by_name(np, name);
128
- if (!timing_np) {
129
- pr_err("%pOF: could not find node '%s'\n", np, name);
128
+ if (!timing_np)
130129 return -ENOENT;
131
- }
132130
133
- return of_parse_display_timing(timing_np, dt);
131
+ ret = of_parse_display_timing(timing_np, dt);
132
+
133
+ of_node_put(timing_np);
134
+
135
+ return ret;
134136 }
135137 EXPORT_SYMBOL_GPL(of_get_display_timing);
136138
....@@ -170,7 +172,7 @@
170172 goto entryfail;
171173 }
172174
173
- pr_debug("%pOF: using %s as default timing\n", np, entry->name);
175
+ pr_debug("%pOF: using %pOFn as default timing\n", np, entry);
174176
175177 native_mode = entry;
176178