Commit c1e63055 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: v4l2-fwnode: cleanup functions that parse endpoints

There is already a typedef for the parse endpoint function.
However, instead of using it, it is redefined at the C file
(and on one of the function headers).

Replace them by the function typedef, in order to cleanup
several related coding style warnings.
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 6087b215
...@@ -599,9 +599,7 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev, ...@@ -599,9 +599,7 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev,
struct v4l2_async_notifier *notifier, struct v4l2_async_notifier *notifier,
struct fwnode_handle *endpoint, struct fwnode_handle *endpoint,
unsigned int asd_struct_size, unsigned int asd_struct_size,
int (*parse_endpoint)(struct device *dev, parse_endpoint_func parse_endpoint)
struct v4l2_fwnode_endpoint *vep,
struct v4l2_async_subdev *asd))
{ {
struct v4l2_fwnode_endpoint vep = { .bus_type = 0 }; struct v4l2_fwnode_endpoint vep = { .bus_type = 0 };
struct v4l2_async_subdev *asd; struct v4l2_async_subdev *asd;
...@@ -657,13 +655,12 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev, ...@@ -657,13 +655,12 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device *dev,
} }
static int static int
__v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, __v4l2_async_notifier_parse_fwnode_ep(struct device *dev,
struct v4l2_async_notifier *notifier, struct v4l2_async_notifier *notifier,
size_t asd_struct_size, size_t asd_struct_size,
unsigned int port, bool has_port, unsigned int port,
int (*parse_endpoint)(struct device *dev, bool has_port,
struct v4l2_fwnode_endpoint *vep, parse_endpoint_func parse_endpoint)
struct v4l2_async_subdev *asd))
{ {
struct fwnode_handle *fwnode; struct fwnode_handle *fwnode;
int ret = 0; int ret = 0;
...@@ -710,26 +707,22 @@ int ...@@ -710,26 +707,22 @@ int
v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev,
struct v4l2_async_notifier *notifier, struct v4l2_async_notifier *notifier,
size_t asd_struct_size, size_t asd_struct_size,
int (*parse_endpoint)(struct device *dev, parse_endpoint_func parse_endpoint)
struct v4l2_fwnode_endpoint *vep,
struct v4l2_async_subdev *asd))
{ {
return __v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier, return __v4l2_async_notifier_parse_fwnode_ep(dev, notifier,
asd_struct_size, 0, asd_struct_size, 0,
false, false, parse_endpoint);
parse_endpoint);
} }
EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_endpoints); EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_endpoints);
int int
v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev, v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev,
struct v4l2_async_notifier *notifier, struct v4l2_async_notifier *notifier,
size_t asd_struct_size, unsigned int port, size_t asd_struct_size,
int (*parse_endpoint)(struct device *dev, unsigned int port,
struct v4l2_fwnode_endpoint *vep, parse_endpoint_func parse_endpoint)
struct v4l2_async_subdev *asd))
{ {
return __v4l2_async_notifier_parse_fwnode_endpoints(dev, notifier, return __v4l2_async_notifier_parse_fwnode_ep(dev, notifier,
asd_struct_size, asd_struct_size,
port, true, port, true,
parse_endpoint); parse_endpoint);
...@@ -1177,10 +1170,9 @@ EXPORT_SYMBOL_GPL(v4l2_async_register_subdev_sensor_common); ...@@ -1177,10 +1170,9 @@ EXPORT_SYMBOL_GPL(v4l2_async_register_subdev_sensor_common);
int v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd, int v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd,
size_t asd_struct_size, size_t asd_struct_size,
unsigned int *ports, unsigned int num_ports, unsigned int *ports,
int (*parse_endpoint)(struct device *dev, unsigned int num_ports,
struct v4l2_fwnode_endpoint *vep, parse_endpoint_func parse_endpoint)
struct v4l2_async_subdev *asd))
{ {
struct v4l2_async_notifier *notifier; struct v4l2_async_notifier *notifier;
struct device *dev = sd->dev; struct device *dev = sd->dev;
......
...@@ -347,7 +347,8 @@ v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev, ...@@ -347,7 +347,8 @@ v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev,
int int
v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev, v4l2_async_notifier_parse_fwnode_endpoints_by_port(struct device *dev,
struct v4l2_async_notifier *notifier, struct v4l2_async_notifier *notifier,
size_t asd_struct_size, unsigned int port, size_t asd_struct_size,
unsigned int port,
parse_endpoint_func parse_endpoint); parse_endpoint_func parse_endpoint);
/** /**
...@@ -406,8 +407,6 @@ v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd, ...@@ -406,8 +407,6 @@ v4l2_async_register_fwnode_subdev(struct v4l2_subdev *sd,
size_t asd_struct_size, size_t asd_struct_size,
unsigned int *ports, unsigned int *ports,
unsigned int num_ports, unsigned int num_ports,
int (*parse_endpoint)(struct device *dev, parse_endpoint_func parse_endpoint);
struct v4l2_fwnode_endpoint *vep,
struct v4l2_async_subdev *asd));
#endif /* _V4L2_FWNODE_H */ #endif /* _V4L2_FWNODE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment