summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-11-01 09:12:13 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-11-01 12:25:28 -0400
commite2cec86528becf143341e2c5c59921bd6cfa1f45 (patch)
treeeb8c7f07f70a84f994cc35458466adef76178082
parent1acce5f72cfabcafee5e101b9ac7d71ebe1c7af9 (diff)
downloadlinux-e2cec86528becf143341e2c5c59921bd6cfa1f45.tar.gz
linux-e2cec86528becf143341e2c5c59921bd6cfa1f45.tar.bz2
linux-e2cec86528becf143341e2c5c59921bd6cfa1f45.zip
media: v4l2-fwnode: use a typedef for a function callback
That allows having a kernel-doc markup for the function prototype. It also prevents the need of describing the return values twice. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
-rw-r--r--include/media/v4l2-fwnode.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index ca50108dfd8f..b5b465677d28 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -203,6 +203,26 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *fwnode,
*/
void v4l2_fwnode_put_link(struct v4l2_fwnode_link *link);
+
+/**
+ * typedef parse_endpoint_func - Driver's callback function to be called on
+ * each V4L2 fwnode endpoint.
+ *
+ * @dev: pointer to &struct device
+ * @vep: pointer to &struct v4l2_fwnode_endpoint
+ * @asd: pointer to &struct v4l2_async_subdev
+ *
+ * Return:
+ * * %0 on success
+ * * %-ENOTCONN if the endpoint is to be skipped but this
+ * should not be considered as an error
+ * * %-EINVAL if the endpoint configuration is invalid
+ */
+typedef int (*parse_endpoint_func)(struct device *dev,
+ struct v4l2_fwnode_endpoint *vep,
+ struct v4l2_async_subdev *asd);
+
+
/**
* v4l2_async_notifier_parse_fwnode_endpoints - Parse V4L2 fwnode endpoints in a
* device node
@@ -215,10 +235,6 @@ void v4l2_fwnode_put_link(struct v4l2_fwnode_link *link);
* begin at the same memory address.
* @parse_endpoint: Driver's callback function called on each V4L2 fwnode
* endpoint. Optional.
- * Return: %0 on success
- * %-ENOTCONN if the endpoint is to be skipped but this
- * should not be considered as an error
- * %-EINVAL if the endpoint configuration is invalid
*
* Parse the fwnode endpoints of the @dev device and populate the async sub-
* devices array of the notifier. The @parse_endpoint callback function is
@@ -253,9 +269,7 @@ void v4l2_fwnode_put_link(struct v4l2_fwnode_link *link);
int v4l2_async_notifier_parse_fwnode_endpoints(
struct device *dev, struct v4l2_async_notifier *notifier,
size_t asd_struct_size,
- int (*parse_endpoint)(struct device *dev,
- struct v4l2_fwnode_endpoint *vep,
- struct v4l2_async_subdev *asd));
+ parse_endpoint_func parse_endpoint);
/**
* v4l2_async_notifier_parse_fwnode_endpoints_by_port - Parse V4L2 fwnode
@@ -271,10 +285,6 @@ int v4l2_async_notifier_parse_fwnode_endpoints(
* @port: port number where endpoints are to be parsed
* @parse_endpoint: Driver's callback function called on each V4L2 fwnode
* endpoint. Optional.
- * Return: %0 on success
- * %-ENOTCONN if the endpoint is to be skipped but this
- * should not be considered as an error
- * %-EINVAL if the endpoint configuration is invalid
*
* This function is just like v4l2_async_notifier_parse_fwnode_endpoints() with
* the exception that it only parses endpoints in a given port. This is useful
@@ -315,9 +325,7 @@ int v4l2_async_notifier_parse_fwnode_endpoints(
int v4l2_async_notifier_parse_fwnode_endpoints_by_port(
struct device *dev, struct v4l2_async_notifier *notifier,
size_t asd_struct_size, unsigned int port,
- int (*parse_endpoint)(struct device *dev,
- struct v4l2_fwnode_endpoint *vep,
- struct v4l2_async_subdev *asd));
+ parse_endpoint_func parse_endpoint);
/**
* v4l2_fwnode_reference_parse_sensor_common - parse common references on