diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-04-04 13:41:25 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 14:07:57 -0300 |
commit | b8d9904c3525c0a149976ffaad48fcb03e8703f7 (patch) | |
tree | ac116e518f70a694046752a05c16a5285bc4713f /drivers/media/video/pxa_camera.c | |
parent | ce54093cefd64c1a2cb6b8c5ed1d68d2bd7a34ab (diff) | |
download | op-kernel-dev-b8d9904c3525c0a149976ffaad48fcb03e8703f7.zip op-kernel-dev-b8d9904c3525c0a149976ffaad48fcb03e8703f7.tar.gz |
V4L/DVB (7500): soc-camera: extract function pointers from host object into operations
Function pointers and the driver owner are not expected to change
throughout soc-camera host's life. Extract them into an operations struct.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pxa_camera.c')
-rw-r--r-- | drivers/media/video/pxa_camera.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index 4756699..9758f7e 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c @@ -803,20 +803,25 @@ static int pxa_camera_querycap(struct soc_camera_host *ici, return 0; } -/* Should beallocated dynamically too, but we have only one. */ +static struct soc_camera_host_ops pxa_soc_camera_host_ops = { + .owner = THIS_MODULE, + .add = pxa_camera_add_device, + .remove = pxa_camera_remove_device, + .set_fmt_cap = pxa_camera_set_fmt_cap, + .try_fmt_cap = pxa_camera_try_fmt_cap, + .reqbufs = pxa_camera_reqbufs, + .poll = pxa_camera_poll, + .querycap = pxa_camera_querycap, + .try_bus_param = pxa_camera_try_bus_param, + .set_bus_param = pxa_camera_set_bus_param, +}; + +/* Should be allocated dynamically too, but we have only one. */ static struct soc_camera_host pxa_soc_camera_host = { .drv_name = PXA_CAM_DRV_NAME, .vbq_ops = &pxa_videobuf_ops, - .add = pxa_camera_add_device, - .remove = pxa_camera_remove_device, .msize = sizeof(struct pxa_buffer), - .set_fmt_cap = pxa_camera_set_fmt_cap, - .try_fmt_cap = pxa_camera_try_fmt_cap, - .reqbufs = pxa_camera_reqbufs, - .poll = pxa_camera_poll, - .querycap = pxa_camera_querycap, - .try_bus_param = pxa_camera_try_bus_param, - .set_bus_param = pxa_camera_set_bus_param, + .ops = &pxa_soc_camera_host_ops, }; static int pxa_camera_probe(struct platform_device *pdev) @@ -912,7 +917,7 @@ static int pxa_camera_probe(struct platform_device *pdev) pxa_soc_camera_host.priv = pcdev; pxa_soc_camera_host.dev.parent = &pdev->dev; pxa_soc_camera_host.nr = pdev->id; - err = soc_camera_host_register(&pxa_soc_camera_host, THIS_MODULE); + err = soc_camera_host_register(&pxa_soc_camera_host); if (err) goto exit_free_irq; |