summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-04 12:50:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-04 12:50:07 -0400
commit3c83e61e67256e0bb08c46cc2db43b58fd617251 (patch)
tree0233e1e04e6449c60b01ff5dea8bea85bcf22f08 /drivers/of
parent4a4389abdd9822fdf3cc2ac6ed87eb811fd43acc (diff)
parenta83b93a7480441a47856dc9104bea970e84cda87 (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: "The main set of series of patches for media subsystem, including: - document RC sysfs class - added an API to setup scancode to allow waking up systems using the Remote Controller - add API for SDR devices. Drivers are still on staging - some API improvements for getting EDID data from media inputs/outputs - new DVB frontend driver for drx-j (ATSC) - one driver (it913x/it9137) got removed, in favor of an improvement on another driver (af9035) - added a skeleton V4L2 PCI driver at documentation - added a dual flash driver (lm3646) - added a new IR driver (img-ir) - added an IR scancode decoder for the Sharp protocol - some improvements at the usbtv driver, to allow its core to be reused. - added a new SDR driver (rtl2832u_sdr) - added a new tuner driver (msi001) - several improvements at em28xx driver to fix PM support, device removal and to split the V4L2 specific bits into a separate sub-driver - one driver got converted to videobuf2 (s2255drv) - the e4000 tuner driver now follows an improved binding model - some fixes at V4L2 compat32 code - several fixes and enhancements at videobuf2 code - some cleanups at V4L2 API documentation - usual driver enhancements, new board additions and misc fixups" [ NOTE! This merge effective drops commit 4329b93b283c ("of: Reduce indentation in of_graph_get_next_endpoint"). The of_graph_get_next_endpoint() function was moved and renamed by commit fd9fdb78a9bf ("[media] of: move graph helpers from drivers/media/v4l2-core to drivers/of"). It was originally called v4l2_of_get_next_endpoint() and lived in the file drivers/media/v4l2-core/v4l2-of.c. In that original location, it was then fixed to support empty port nodes by commit b9db140c1e46 ("[media] v4l: of: Support empty port nodes"), and that commit clashes badly with the dropped "Reduce intendation" commit. I had to choose one or the other, and decided that the "Support empty port nodes" commit was more important ] * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (426 commits) [media] em28xx-dvb: fix PCTV 461e tuner I2C binding Revert "[media] em28xx-dvb: fix PCTV 461e tuner I2C binding" [media] em28xx: fix PCTV 290e LNA oops [media] em28xx-dvb: fix PCTV 461e tuner I2C binding [media] m88ds3103: fix bug on .set_tone() [media] saa7134: fix WARN_ON during resume [media] v4l2-dv-timings: add module name, description, license [media] videodev2.h: add parenthesis around macro arguments [media] saa6752hs: depends on CRC32 [media] si4713: fix Kconfig dependencies [media] Sensoray 2255 uses videobuf2 [media] adv7180: free an interrupt on failure paths in init_device() [media] e4000: make VIDEO_V4L2 dependency optional [media] af9033: Don't export functions for the hardware filter [media] af9035: use af9033 PID filters [media] af9033: implement PID filter [media] rtl2832_sdr: do not use dynamic stack allocation [media] e4000: fix 32-bit build error [media] em28xx-audio: make sure audio is unmuted on open() [media] DocBook media: v4l2_format_sdr was renamed to v4l2_sdr_format ...
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/base.c81
1 files changed, 41 insertions, 40 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 4557a142c752..f72d19b7e5d2 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2196,64 +2196,65 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
2196 struct device_node *prev) 2196 struct device_node *prev)
2197{ 2197{
2198 struct device_node *endpoint; 2198 struct device_node *endpoint;
2199 struct device_node *port = NULL; 2199 struct device_node *port;
2200 2200
2201 if (!parent) 2201 if (!parent)
2202 return NULL; 2202 return NULL;
2203 2203
2204 /*
2205 * Start by locating the port node. If no previous endpoint is specified
2206 * search for the first port node, otherwise get the previous endpoint
2207 * parent port node.
2208 */
2204 if (!prev) { 2209 if (!prev) {
2205 struct device_node *node; 2210 struct device_node *node;
2206 /* 2211
2207 * It's the first call, we have to find a port subnode
2208 * within this node or within an optional 'ports' node.
2209 */
2210 node = of_get_child_by_name(parent, "ports"); 2212 node = of_get_child_by_name(parent, "ports");
2211 if (node) 2213 if (node)
2212 parent = node; 2214 parent = node;
2213 2215
2214 port = of_get_child_by_name(parent, "port"); 2216 port = of_get_child_by_name(parent, "port");
2215
2216 if (port) {
2217 /* Found a port, get an endpoint. */
2218 endpoint = of_get_next_child(port, NULL);
2219 of_node_put(port);
2220 } else {
2221 endpoint = NULL;
2222 }
2223
2224 if (!endpoint)
2225 pr_err("%s(): no endpoint nodes specified for %s\n",
2226 __func__, parent->full_name);
2227 of_node_put(node); 2217 of_node_put(node);
2228 2218
2229 return endpoint; 2219 if (!port) {
2230 } 2220 pr_err("%s(): no port node found in %s\n",
2231 2221 __func__, parent->full_name);
2232 port = of_get_parent(prev); 2222 return NULL;
2233 if (WARN_ONCE(!port, "%s(): endpoint %s has no parent node\n", 2223 }
2234 __func__, prev->full_name)) 2224 } else {
2235 return NULL; 2225 port = of_get_parent(prev);
2226 if (WARN_ONCE(!port, "%s(): endpoint %s has no parent node\n",
2227 __func__, prev->full_name))
2228 return NULL;
2236 2229
2237 /* Avoid dropping prev node refcount to 0. */ 2230 /*
2238 of_node_get(prev); 2231 * Avoid dropping prev node refcount to 0 when getting the next
2239 endpoint = of_get_next_child(port, prev); 2232 * child below.
2240 if (endpoint) { 2233 */
2241 of_node_put(port); 2234 of_node_get(prev);
2242 return endpoint;
2243 } 2235 }
2244 2236
2245 /* No more endpoints under this port, try the next one. */ 2237 while (1) {
2246 do { 2238 /*
2247 port = of_get_next_child(parent, port); 2239 * Now that we have a port node, get the next endpoint by
2248 if (!port) 2240 * getting the next child. If the previous endpoint is NULL this
2249 return NULL; 2241 * will return the first child.
2250 } while (of_node_cmp(port->name, "port")); 2242 */
2243 endpoint = of_get_next_child(port, prev);
2244 if (endpoint) {
2245 of_node_put(port);
2246 return endpoint;
2247 }
2251 2248
2252 /* Pick up the first endpoint in this port. */ 2249 /* No more endpoints under this port, try the next one. */
2253 endpoint = of_get_next_child(port, NULL); 2250 prev = NULL;
2254 of_node_put(port);
2255 2251
2256 return endpoint; 2252 do {
2253 port = of_get_next_child(parent, port);
2254 if (!port)
2255 return NULL;
2256 } while (of_node_cmp(port->name, "port"));
2257 }
2257} 2258}
2258EXPORT_SYMBOL(of_graph_get_next_endpoint); 2259EXPORT_SYMBOL(of_graph_get_next_endpoint);
2259 2260