aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s3c-camif/camif-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-28 09:24:23 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:19:25 -0200
commit2e7508e40f6391762499d802226d8a31b0ea3944 (patch)
tree9e387787970c59d9da8cb38087a4ba96d9718bb6 /drivers/media/platform/s3c-camif/camif-core.c
parent[media] uapi/media.h: Use u32 for the number of graph objects (diff)
downloadlinux-dev-2e7508e40f6391762499d802226d8a31b0ea3944.tar.xz
linux-dev-2e7508e40f6391762499d802226d8a31b0ea3944.zip
[media] call media_device_init() before registering the V4L2 device
Currently, v4l2_device_register() doesn't use the media_device struct. So, calling media_device_init() could be called either before or after v4l2_device_register(). Yet, it is a good practice to initialize everything before calling the register functions. Also, the other drivers call media_device_init() before registering the V4L2 device. So, move the call for media_device_init() to happen earlier on exynos4-is and s3c-camif. This is just a cleanup patch. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--drivers/media/platform/s3c-camif/camif-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c
index ea02b7ef2119..0b44b9accf50 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -324,12 +324,12 @@ static int camif_media_dev_init(struct camif_dev *camif)
strlcpy(v4l2_dev->name, "s3c-camif", sizeof(v4l2_dev->name));
v4l2_dev->mdev = md;
+ media_device_init(md);
+
ret = v4l2_device_register(camif->dev, v4l2_dev);
if (ret < 0)
return ret;
- media_device_init(md);
-
return ret;
}