diff options
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 2 | ||||
-rw-r--r-- | drivers/media/video/v4l2-device.c | 12 | ||||
-rw-r--r-- | include/media/v4l2-subdev.h | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index e1620e2a38ff..accc376e93cc 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -268,7 +268,7 @@ errors (except -ENOIOCTLCMD) occured, then 0 is returned. | |||
268 | 268 | ||
269 | The second argument to both calls is a group ID. If 0, then all subdevs are | 269 | The second argument to both calls is a group ID. If 0, then all subdevs are |
270 | called. If non-zero, then only those whose group ID match that value will | 270 | called. If non-zero, then only those whose group ID match that value will |
271 | be called. Before a bridge driver registers a subdev it can set subdev->grp_id | 271 | be called. Before a bridge driver registers a subdev it can set sd->grp_id |
272 | to whatever value it wants (it's 0 by default). This value is owned by the | 272 | to whatever value it wants (it's 0 by default). This value is owned by the |
273 | bridge driver and the sub-device driver will never modify or use it. | 273 | bridge driver and the sub-device driver will never modify or use it. |
274 | 274 | ||
diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c index 3330ffb7d010..b3dcb8454379 100644 --- a/drivers/media/video/v4l2-device.c +++ b/drivers/media/video/v4l2-device.c | |||
@@ -72,10 +72,10 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, | |||
72 | if (v4l2_dev == NULL || sd == NULL || !sd->name[0]) | 72 | if (v4l2_dev == NULL || sd == NULL || !sd->name[0]) |
73 | return -EINVAL; | 73 | return -EINVAL; |
74 | /* Warn if we apparently re-register a subdev */ | 74 | /* Warn if we apparently re-register a subdev */ |
75 | WARN_ON(sd->dev != NULL); | 75 | WARN_ON(sd->v4l2_dev != NULL); |
76 | if (!try_module_get(sd->owner)) | 76 | if (!try_module_get(sd->owner)) |
77 | return -ENODEV; | 77 | return -ENODEV; |
78 | sd->dev = v4l2_dev; | 78 | sd->v4l2_dev = v4l2_dev; |
79 | spin_lock(&v4l2_dev->lock); | 79 | spin_lock(&v4l2_dev->lock); |
80 | list_add_tail(&sd->list, &v4l2_dev->subdevs); | 80 | list_add_tail(&sd->list, &v4l2_dev->subdevs); |
81 | spin_unlock(&v4l2_dev->lock); | 81 | spin_unlock(&v4l2_dev->lock); |
@@ -86,12 +86,12 @@ EXPORT_SYMBOL_GPL(v4l2_device_register_subdev); | |||
86 | void v4l2_device_unregister_subdev(struct v4l2_subdev *sd) | 86 | void v4l2_device_unregister_subdev(struct v4l2_subdev *sd) |
87 | { | 87 | { |
88 | /* return if it isn't registered */ | 88 | /* return if it isn't registered */ |
89 | if (sd == NULL || sd->dev == NULL) | 89 | if (sd == NULL || sd->v4l2_dev == NULL) |
90 | return; | 90 | return; |
91 | spin_lock(&sd->dev->lock); | 91 | spin_lock(&sd->v4l2_dev->lock); |
92 | list_del(&sd->list); | 92 | list_del(&sd->list); |
93 | spin_unlock(&sd->dev->lock); | 93 | spin_unlock(&sd->v4l2_dev->lock); |
94 | sd->dev = NULL; | 94 | sd->v4l2_dev = NULL; |
95 | module_put(sd->owner); | 95 | module_put(sd->owner); |
96 | } | 96 | } |
97 | EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev); | 97 | EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev); |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index cd640c6f039b..05b69652e6c4 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -137,7 +137,7 @@ struct v4l2_subdev_ops { | |||
137 | struct v4l2_subdev { | 137 | struct v4l2_subdev { |
138 | struct list_head list; | 138 | struct list_head list; |
139 | struct module *owner; | 139 | struct module *owner; |
140 | struct v4l2_device *dev; | 140 | struct v4l2_device *v4l2_dev; |
141 | const struct v4l2_subdev_ops *ops; | 141 | const struct v4l2_subdev_ops *ops; |
142 | /* name must be unique */ | 142 | /* name must be unique */ |
143 | char name[V4L2_SUBDEV_NAME_SIZE]; | 143 | char name[V4L2_SUBDEV_NAME_SIZE]; |
@@ -176,7 +176,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
176 | /* ops->core MUST be set */ | 176 | /* ops->core MUST be set */ |
177 | BUG_ON(!ops || !ops->core); | 177 | BUG_ON(!ops || !ops->core); |
178 | sd->ops = ops; | 178 | sd->ops = ops; |
179 | sd->dev = NULL; | 179 | sd->v4l2_dev = NULL; |
180 | sd->name[0] = '\0'; | 180 | sd->name[0] = '\0'; |
181 | sd->grp_id = 0; | 181 | sd->grp_id = 0; |
182 | sd->priv = NULL; | 182 | sd->priv = NULL; |