From: Hans Verkuil Date: Wed, 12 Jun 2013 09:03:27 +0000 (-0300) Subject: [media] omap24xxcam: add v4l2_device and replace parent with v4l2_dev X-Git-Tag: v3.11-rc1~17^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a86969bd65eb7f19ea1c281c686a75429be950a;p=profile%2Fivi%2Fkernel-x86-ivi.git [media] omap24xxcam: add v4l2_device and replace parent with v4l2_dev This driver did not yet support struct v4l2_device, so add it. This make it possible to replace the deprecated parent field with the v4l2_dev field, allowing the eventual removal of the parent field. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/omap24xxcam.c b/drivers/media/platform/omap24xxcam.c index debb44c..d2b440c 100644 --- a/drivers/media/platform/omap24xxcam.c +++ b/drivers/media/platform/omap24xxcam.c @@ -1656,7 +1656,7 @@ static int omap24xxcam_device_register(struct v4l2_int_device *s) } vfd->release = video_device_release; - vfd->parent = cam->dev; + vfd->v4l2_dev = &cam->v4l2_dev; strlcpy(vfd->name, CAM_NAME, sizeof(vfd->name)); vfd->fops = &omap24xxcam_fops; @@ -1752,6 +1752,11 @@ static int omap24xxcam_probe(struct platform_device *pdev) cam->dev = &pdev->dev; + if (v4l2_device_register(&pdev->dev, &cam->v4l2_dev)) { + dev_err(&pdev->dev, "v4l2_device_register failed\n"); + goto err; + } + /* * Impose a lower limit on the amount of memory allocated for * capture. We require at least enough memory to double-buffer @@ -1849,6 +1854,8 @@ static int omap24xxcam_remove(struct platform_device *pdev) cam->mmio_base_phys = 0; } + v4l2_device_unregister(&cam->v4l2_dev); + kfree(cam); return 0; diff --git a/drivers/media/platform/omap24xxcam.h b/drivers/media/platform/omap24xxcam.h index c439595..7f6f791 100644 --- a/drivers/media/platform/omap24xxcam.h +++ b/drivers/media/platform/omap24xxcam.h @@ -29,6 +29,7 @@ #include #include +#include /* * @@ -462,6 +463,8 @@ struct omap24xxcam_device { */ struct mutex mutex; + struct v4l2_device v4l2_dev; + /*** general driver state information ***/ atomic_t users; /*