v4l2-of: fix compiler errors if CONFIG_OF is undefined
PATCH 1/1 v4l2-of: fix compiler errors if CONFIG_OF is undefined
You must use static inline otherwise you get these errors if CONFIG_OF is not defined:
In file included from drivers/media/platform/soc_camera/soc_camera.c:39:0:include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
^
In file included from drivers/media/platform/soc_camera/atmel-isi.c:28:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
^
In file included from drivers/media/platform/soc_camera/rcar_vin.c:36:0:
include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
^---
include/media/v4l2-of.h +2 -2
@@ -103,13 +103,13 @@ static inline int v4l2_of_parse_endpoint(const struct device_node *node,return -ENOSYS ; } -struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint ( +static inline struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint (const struct device_node *node) {return NULL ; } -static void v4l2_of_free_endpoint (struct v4l2_of_endpoint *endpoint) +static inline void v4l2_of_free_endpoint (struct v4l2_of_endpoint *endpoint) { }
Hi Hans,
Quoted 27 lines · Hans Verkuil
You must use static inline otherwise you get these errors if
CONFIG_OFis not defined:In file included from
drivers/media/platform/soc_camera/soc_camera.c:39:0:include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
static voidv4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)^ In file included from drivers/media/platform/soc_camera/atmel-isi.c:28:0: include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function] static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint) ^ In file included from drivers/media/platform/soc_camera/rcar_vin.c:36:0: include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function] static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint) ^Signed-off-by Hans Verkuil <[email protected]>---
include/media/v4l2-of.h +1
-1@@ -103,13 +103,13 @@ static inline int v4l2_of_parse_endpoint(const struct device_node *node,return -ENOSYS ; } -struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint( +static inline struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint(
include/media/v4l2-of.h static inline int v4l2_of_parse_endpoint(const struct device_node *node, · line 115
Quoted 10 lines
include/media/v4l2-of.h +1
-1const struct device_node *node) {return NULL ; } -static void v4l2_of_free_endpoint (struct v4l2_of_endpoint *endpoint) +static inline void v4l2_of_free_endpoint (struct v4l2_of_endpoint *endpoint) { }
Oops. My bad. Thanks for the patch!
Signature · 2 lines
Sakari Ailus e-mail: [email protected] XMPP: [email protected]