Skip to content

Commit

Permalink
[media] omap24xxcam: add v4l2_device and replace parent with v4l2_dev
Browse files Browse the repository at this point in the history
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 <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jun 21, 2013
1 parent b60f9aa commit 7a86969
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/media/platform/omap24xxcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions drivers/media/platform/omap24xxcam.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <media/videobuf-dma-sg.h>
#include <media/v4l2-int-device.h>
#include <media/v4l2-device.h>

/*
*
Expand Down Expand Up @@ -462,6 +463,8 @@ struct omap24xxcam_device {
*/
struct mutex mutex;

struct v4l2_device v4l2_dev;

/*** general driver state information ***/
atomic_t users;
/*
Expand Down

0 comments on commit 7a86969

Please sign in to comment.