Skip to content

Commit

Permalink
media: v4l: fwnode: Rename and make static V4L2 async notifier helper
Browse files Browse the repository at this point in the history
Rename v4l2_async_notifier_parse_fwnode_sensor_common() as
v4l2_async_notifier_parse_fwnode_sensor() and make the function static, as
it's not used by a driver and maybe never will.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Sakari Ailus authored and mchehab committed Apr 6, 2021
1 parent 4ebddb7 commit 9e7fabb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
27 changes: 22 additions & 5 deletions drivers/media/v4l2-core/v4l2-fwnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,27 @@ v4l2_fwnode_reference_parse_int_props(struct device *dev,
return !fwnode || PTR_ERR(fwnode) == -ENOENT ? 0 : PTR_ERR(fwnode);
}

int v4l2_async_notifier_parse_fwnode_sensor_common(struct device *dev,
struct v4l2_async_notifier *notifier)
/**
* v4l2_async_notifier_parse_fwnode_sensor - parse common references on
* sensors for async sub-devices
* @dev: the device node the properties of which are parsed for references
* @notifier: the async notifier where the async subdevs will be added
*
* Parse common sensor properties for remote devices related to the
* sensor and set up async sub-devices for them.
*
* Any notifier populated using this function must be released with a call to
* v4l2_async_notifier_release() after it has been unregistered and the async
* sub-devices are no longer in use, even in the case the function returned an
* error.
*
* Return: 0 on success
* -ENOMEM if memory allocation failed
* -EINVAL if property parsing failed
*/
static int
v4l2_async_notifier_parse_fwnode_sensor(struct device *dev,
struct v4l2_async_notifier *notifier)
{
static const char * const led_props[] = { "led" };
static const struct v4l2_fwnode_int_props props[] = {
Expand Down Expand Up @@ -1288,7 +1307,6 @@ int v4l2_async_notifier_parse_fwnode_sensor_common(struct device *dev,

return 0;
}
EXPORT_SYMBOL_GPL(v4l2_async_notifier_parse_fwnode_sensor_common);

int v4l2_async_register_subdev_sensor_common(struct v4l2_subdev *sd)
{
Expand All @@ -1304,8 +1322,7 @@ int v4l2_async_register_subdev_sensor_common(struct v4l2_subdev *sd)

v4l2_async_notifier_init(notifier);

ret = v4l2_async_notifier_parse_fwnode_sensor_common(sd->dev,
notifier);
ret = v4l2_async_notifier_parse_fwnode_sensor(sd->dev, notifier);
if (ret < 0)
goto out_cleanup;

Expand Down
2 changes: 1 addition & 1 deletion include/media/v4l2-async.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd);
*
* This function is just like v4l2_async_register_subdev() with the exception
* that calling it will also parse firmware interfaces for remote references
* using v4l2_async_notifier_parse_fwnode_sensor_common() and registers the
* using v4l2_async_notifier_parse_fwnode_sensor() and registers the
* async sub-devices. The sub-device is similarly unregistered by calling
* v4l2_async_unregister_subdev().
*
Expand Down
21 changes: 0 additions & 21 deletions include/media/v4l2-fwnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,27 +510,6 @@ v4l2_async_notifier_parse_fwnode_endpoints(struct device *dev,
size_t asd_struct_size,
parse_endpoint_func parse_endpoint);

/**
* v4l2_async_notifier_parse_fwnode_sensor_common - parse common references on
* sensors for async sub-devices
* @dev: the device node the properties of which are parsed for references
* @notifier: the async notifier where the async subdevs will be added
*
* Parse common sensor properties for remote devices related to the
* sensor and set up async sub-devices for them.
*
* Any notifier populated using this function must be released with a call to
* v4l2_async_notifier_release() after it has been unregistered and the async
* sub-devices are no longer in use, even in the case the function returned an
* error.
*
* Return: 0 on success
* -ENOMEM if memory allocation failed
* -EINVAL if property parsing failed
*/
int v4l2_async_notifier_parse_fwnode_sensor_common(struct device *dev,
struct v4l2_async_notifier *notifier);

/* Helper macros to access the connector links. */

/** v4l2_connector_last_link - Helper macro to get the first
Expand Down

0 comments on commit 9e7fabb

Please sign in to comment.