aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l2-device.c')
-rw-r--r--drivers/media/video/v4l2-device.c12
1 files changed, 6 insertions, 6 deletions
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);
86void v4l2_device_unregister_subdev(struct v4l2_subdev *sd) 86void 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}
97EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev); 97EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev);