* [PATCH 0/3] V4L2 OF fixes
@ 2013-12-04 19:29 Laurent Pinchart
2013-12-04 19:29 ` [PATCH 1/3] v4l: of: Return an int in v4l2_of_parse_endpoint() Laurent Pinchart
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Laurent Pinchart @ 2013-12-04 19:29 UTC (permalink / raw)
To: linux-media; +Cc: Guennadi Liakhovetski, Sylwester Nawrocki
Hello,
Here are three small fixes for the V4L2 OF parsing code. The patches should be
self-explanatory.
Laurent Pinchart (3):
v4l: of: Return an int in v4l2_of_parse_endpoint()
v4l: of: Remove struct v4l2_of_endpoint remote field
v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port()
drivers/media/v4l2-core/v4l2-of.c | 10 +++++++---
include/media/v4l2-of.h | 6 ++----
2 files changed, 9 insertions(+), 7 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] v4l: of: Return an int in v4l2_of_parse_endpoint()
2013-12-04 19:29 [PATCH 0/3] V4L2 OF fixes Laurent Pinchart
@ 2013-12-04 19:29 ` Laurent Pinchart
2013-12-04 19:29 ` [PATCH 2/3] v4l: of: Remove struct v4l2_of_endpoint remote field Laurent Pinchart
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2013-12-04 19:29 UTC (permalink / raw)
To: linux-media; +Cc: Guennadi Liakhovetski, Sylwester Nawrocki
When CONFIG_OF is not defined the v4l2_of_parse_endpoint() function is
defined as a stub that returns -ENOSYS. Make the real function return an
integer as well to be able to differentiate between the two cases.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/v4l2-core/v4l2-of.c | 8 ++++++--
include/media/v4l2-of.h | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index a6478dc..66a0e23 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -121,9 +121,11 @@ static void v4l2_of_parse_parallel_bus(const struct device_node *node,
* the bus as serial CSI-2 and clock-noncontinuous isn't set, we set the
* V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag.
* The caller should hold a reference to @node.
+ *
+ * Return: 0.
*/
-void v4l2_of_parse_endpoint(const struct device_node *node,
- struct v4l2_of_endpoint *endpoint)
+int v4l2_of_parse_endpoint(const struct device_node *node,
+ struct v4l2_of_endpoint *endpoint)
{
struct device_node *port_node = of_get_parent(node);
@@ -146,6 +148,8 @@ void v4l2_of_parse_endpoint(const struct device_node *node,
v4l2_of_parse_parallel_bus(node, endpoint);
of_node_put(port_node);
+
+ return 0;
}
EXPORT_SYMBOL(v4l2_of_parse_endpoint);
diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
index 3a8a841..3480cd0 100644
--- a/include/media/v4l2-of.h
+++ b/include/media/v4l2-of.h
@@ -72,8 +72,8 @@ struct v4l2_of_endpoint {
};
#ifdef CONFIG_OF
-void v4l2_of_parse_endpoint(const struct device_node *node,
- struct v4l2_of_endpoint *link);
+int v4l2_of_parse_endpoint(const struct device_node *node,
+ struct v4l2_of_endpoint *endpoint);
struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent,
struct device_node *previous);
struct device_node *v4l2_of_get_remote_port_parent(
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] v4l: of: Remove struct v4l2_of_endpoint remote field
2013-12-04 19:29 [PATCH 0/3] V4L2 OF fixes Laurent Pinchart
2013-12-04 19:29 ` [PATCH 1/3] v4l: of: Return an int in v4l2_of_parse_endpoint() Laurent Pinchart
@ 2013-12-04 19:29 ` Laurent Pinchart
2013-12-04 19:29 ` [PATCH 3/3] v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port() Laurent Pinchart
2013-12-04 23:05 ` [PATCH 0/3] V4L2 OF fixes Sylwester Nawrocki
3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2013-12-04 19:29 UTC (permalink / raw)
To: linux-media; +Cc: Guennadi Liakhovetski, Sylwester Nawrocki
The field isn't set when parsing the endpoint. Remove it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/media/v4l2-of.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
index 3480cd0..541cea4 100644
--- a/include/media/v4l2-of.h
+++ b/include/media/v4l2-of.h
@@ -53,7 +53,6 @@ struct v4l2_of_bus_parallel {
* @port: identifier (value of reg property) of a port this endpoint belongs to
* @id: identifier (value of reg property) of this endpoint
* @local_node: pointer to device_node of this endpoint
- * @remote: phandle to remote endpoint node
* @bus_type: bus type
* @bus: bus configuration data structure
* @head: list head for this structure
@@ -62,7 +61,6 @@ struct v4l2_of_endpoint {
unsigned int port;
unsigned int id;
const struct device_node *local_node;
- const __be32 *remote;
enum v4l2_mbus_type bus_type;
union {
struct v4l2_of_bus_parallel parallel;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port()
2013-12-04 19:29 [PATCH 0/3] V4L2 OF fixes Laurent Pinchart
2013-12-04 19:29 ` [PATCH 1/3] v4l: of: Return an int in v4l2_of_parse_endpoint() Laurent Pinchart
2013-12-04 19:29 ` [PATCH 2/3] v4l: of: Remove struct v4l2_of_endpoint remote field Laurent Pinchart
@ 2013-12-04 19:29 ` Laurent Pinchart
2013-12-04 23:05 ` [PATCH 0/3] V4L2 OF fixes Sylwester Nawrocki
3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2013-12-04 19:29 UTC (permalink / raw)
To: linux-media; +Cc: Guennadi Liakhovetski, Sylwester Nawrocki
The v4l2_of_get_remote_port() function acquires a reference to an
endpoint node through a phandle and then returns the node's parent,
without dropping the reference to the endpoint node. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/v4l2-core/v4l2-of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index 66a0e23..42e3e8a 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -266,6 +266,6 @@ struct device_node *v4l2_of_get_remote_port(const struct device_node *node)
np = of_parse_phandle(node, "remote-endpoint", 0);
if (!np)
return NULL;
- return of_get_parent(np);
+ return of_get_next_parent(np);
}
EXPORT_SYMBOL(v4l2_of_get_remote_port);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] V4L2 OF fixes
2013-12-04 19:29 [PATCH 0/3] V4L2 OF fixes Laurent Pinchart
` (2 preceding siblings ...)
2013-12-04 19:29 ` [PATCH 3/3] v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port() Laurent Pinchart
@ 2013-12-04 23:05 ` Sylwester Nawrocki
3 siblings, 0 replies; 5+ messages in thread
From: Sylwester Nawrocki @ 2013-12-04 23:05 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, Guennadi Liakhovetski, Sylwester Nawrocki
Hi Laurent,
On 12/04/2013 08:29 PM, Laurent Pinchart wrote:
> Hello,
>
> Here are three small fixes for the V4L2 OF parsing code. The patches should be
> self-explanatory.
>
> Laurent Pinchart (3):
> v4l: of: Return an int in v4l2_of_parse_endpoint()
> v4l: of: Remove struct v4l2_of_endpoint remote field
> v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port()
Thank you for the fixes, all three patches
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
--
Regards,
Sylwester
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-12-04 23:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04 19:29 [PATCH 0/3] V4L2 OF fixes Laurent Pinchart
2013-12-04 19:29 ` [PATCH 1/3] v4l: of: Return an int in v4l2_of_parse_endpoint() Laurent Pinchart
2013-12-04 19:29 ` [PATCH 2/3] v4l: of: Remove struct v4l2_of_endpoint remote field Laurent Pinchart
2013-12-04 19:29 ` [PATCH 3/3] v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port() Laurent Pinchart
2013-12-04 23:05 ` [PATCH 0/3] V4L2 OF fixes Sylwester Nawrocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.