summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s5p-fimc/fimc-mdevice.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-11-22 06:17:19 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-26 18:29:31 -0200
commit97d66c47277fc801bc1ee93559a848057181ea55 (patch)
tree38e5b038cd68529b9fb1a3bfedf2f2ac4f06a9e6 /drivers/media/platform/s5p-fimc/fimc-mdevice.c
parent86163adb8125a4ce85e0b23a50be82bd8c0daf95 (diff)
downloadtalos-obmc-linux-97d66c47277fc801bc1ee93559a848057181ea55.tar.gz
talos-obmc-linux-97d66c47277fc801bc1ee93559a848057181ea55.zip
[media] s5p-fimc: Prevent race conditions during subdevs registration
Make sure when fimc and fimc-lite capture video node is registered it has valid pipeline_ops assigned to it. Otherwise when a video node is opened right after is was registered there, might be an attempt to use ops that are just being assigned, after function v4l2_device_register_subdev() returns. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/s5p-fimc/fimc-mdevice.c')
-rw-r--r--drivers/media/platform/s5p-fimc/fimc-mdevice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
index 38ea4d143a49..0531ab70a94c 100644
--- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c
+++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
@@ -352,6 +352,7 @@ static int fimc_register_callback(struct device *dev, void *p)
sd = &fimc->vid_cap.subdev;
sd->grp_id = FIMC_GROUP_ID;
+ v4l2_set_subdev_hostdata(sd, (void *)&fimc_pipeline_ops);
ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd);
if (ret) {
@@ -360,7 +361,6 @@ static int fimc_register_callback(struct device *dev, void *p)
return ret;
}
- fimc->pipeline_ops = &fimc_pipeline_ops;
fmd->fimc[fimc->id] = fimc;
return 0;
}
@@ -375,6 +375,7 @@ static int fimc_lite_register_callback(struct device *dev, void *p)
return 0;
fimc->subdev.grp_id = FLITE_GROUP_ID;
+ v4l2_set_subdev_hostdata(&fimc->subdev, (void *)&fimc_pipeline_ops);
ret = v4l2_device_register_subdev(&fmd->v4l2_dev, &fimc->subdev);
if (ret) {
@@ -384,7 +385,6 @@ static int fimc_lite_register_callback(struct device *dev, void *p)
return ret;
}
- fimc->pipeline_ops = &fimc_pipeline_ops;
fmd->fimc_lite[fimc->index] = fimc;
return 0;
}
OpenPOWER on IntegriCloud