V4L/DVB (10644): v4l2-subdev: rename dev field to v4l2_dev
Remain consistent in the naming: fields pointing to v4l2_device should be called v4l2_dev. There are too many device-like entities without adding to the confusion by mixing naming conventions. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
3a63e4492f
commit
b016760054
|
@ -268,7 +268,7 @@ errors (except -ENOIOCTLCMD) occured, then 0 is returned.
|
||||||
|
|
||||||
The second argument to both calls is a group ID. If 0, then all subdevs are
|
The second argument to both calls is a group ID. If 0, then all subdevs are
|
||||||
called. If non-zero, then only those whose group ID match that value will
|
called. If non-zero, then only those whose group ID match that value will
|
||||||
be called. Before a bridge driver registers a subdev it can set subdev->grp_id
|
be called. Before a bridge driver registers a subdev it can set sd->grp_id
|
||||||
to whatever value it wants (it's 0 by default). This value is owned by the
|
to whatever value it wants (it's 0 by default). This value is owned by the
|
||||||
bridge driver and the sub-device driver will never modify or use it.
|
bridge driver and the sub-device driver will never modify or use it.
|
||||||
|
|
||||||
|
|
|
@ -72,10 +72,10 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,
|
||||||
if (v4l2_dev == NULL || sd == NULL || !sd->name[0])
|
if (v4l2_dev == NULL || sd == NULL || !sd->name[0])
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
/* Warn if we apparently re-register a subdev */
|
/* Warn if we apparently re-register a subdev */
|
||||||
WARN_ON(sd->dev != NULL);
|
WARN_ON(sd->v4l2_dev != NULL);
|
||||||
if (!try_module_get(sd->owner))
|
if (!try_module_get(sd->owner))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
sd->dev = v4l2_dev;
|
sd->v4l2_dev = v4l2_dev;
|
||||||
spin_lock(&v4l2_dev->lock);
|
spin_lock(&v4l2_dev->lock);
|
||||||
list_add_tail(&sd->list, &v4l2_dev->subdevs);
|
list_add_tail(&sd->list, &v4l2_dev->subdevs);
|
||||||
spin_unlock(&v4l2_dev->lock);
|
spin_unlock(&v4l2_dev->lock);
|
||||||
|
@ -86,12 +86,12 @@ EXPORT_SYMBOL_GPL(v4l2_device_register_subdev);
|
||||||
void v4l2_device_unregister_subdev(struct v4l2_subdev *sd)
|
void v4l2_device_unregister_subdev(struct v4l2_subdev *sd)
|
||||||
{
|
{
|
||||||
/* return if it isn't registered */
|
/* return if it isn't registered */
|
||||||
if (sd == NULL || sd->dev == NULL)
|
if (sd == NULL || sd->v4l2_dev == NULL)
|
||||||
return;
|
return;
|
||||||
spin_lock(&sd->dev->lock);
|
spin_lock(&sd->v4l2_dev->lock);
|
||||||
list_del(&sd->list);
|
list_del(&sd->list);
|
||||||
spin_unlock(&sd->dev->lock);
|
spin_unlock(&sd->v4l2_dev->lock);
|
||||||
sd->dev = NULL;
|
sd->v4l2_dev = NULL;
|
||||||
module_put(sd->owner);
|
module_put(sd->owner);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev);
|
EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev);
|
||||||
|
|
|
@ -137,7 +137,7 @@ struct v4l2_subdev_ops {
|
||||||
struct v4l2_subdev {
|
struct v4l2_subdev {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
struct module *owner;
|
struct module *owner;
|
||||||
struct v4l2_device *dev;
|
struct v4l2_device *v4l2_dev;
|
||||||
const struct v4l2_subdev_ops *ops;
|
const struct v4l2_subdev_ops *ops;
|
||||||
/* name must be unique */
|
/* name must be unique */
|
||||||
char name[V4L2_SUBDEV_NAME_SIZE];
|
char name[V4L2_SUBDEV_NAME_SIZE];
|
||||||
|
@ -176,7 +176,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
|
||||||
/* ops->core MUST be set */
|
/* ops->core MUST be set */
|
||||||
BUG_ON(!ops || !ops->core);
|
BUG_ON(!ops || !ops->core);
|
||||||
sd->ops = ops;
|
sd->ops = ops;
|
||||||
sd->dev = NULL;
|
sd->v4l2_dev = NULL;
|
||||||
sd->name[0] = '\0';
|
sd->name[0] = '\0';
|
||||||
sd->grp_id = 0;
|
sd->grp_id = 0;
|
||||||
sd->priv = NULL;
|
sd->priv = NULL;
|
||||||
|
|
Loading…
Reference in New Issue