diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-04-04 12:41:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:57 -0400 |
commit | b8d9904c3525c0a149976ffaad48fcb03e8703f7 (patch) | |
tree | ac116e518f70a694046752a05c16a5285bc4713f /drivers/media/video/pxa_camera.c | |
parent | ce54093cefd64c1a2cb6b8c5ed1d68d2bd7a34ab (diff) |
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 4756699d16aa..9758f7eb5932 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, | |||
803 | return 0; | 803 | return 0; |
804 | } | 804 | } |
805 | 805 | ||
806 | /* Should beallocated dynamically too, but we have only one. */ | 806 | static struct soc_camera_host_ops pxa_soc_camera_host_ops = { |
807 | .owner = THIS_MODULE, | ||
808 | .add = pxa_camera_add_device, | ||
809 | .remove = pxa_camera_remove_device, | ||
810 | .set_fmt_cap = pxa_camera_set_fmt_cap, | ||
811 | .try_fmt_cap = pxa_camera_try_fmt_cap, | ||
812 | .reqbufs = pxa_camera_reqbufs, | ||
813 | .poll = pxa_camera_poll, | ||
814 | .querycap = pxa_camera_querycap, | ||
815 | .try_bus_param = pxa_camera_try_bus_param, | ||
816 | .set_bus_param = pxa_camera_set_bus_param, | ||
817 | }; | ||
818 | |||
819 | /* Should be allocated dynamically too, but we have only one. */ | ||
807 | static struct soc_camera_host pxa_soc_camera_host = { | 820 | static struct soc_camera_host pxa_soc_camera_host = { |
808 | .drv_name = PXA_CAM_DRV_NAME, | 821 | .drv_name = PXA_CAM_DRV_NAME, |
809 | .vbq_ops = &pxa_videobuf_ops, | 822 | .vbq_ops = &pxa_videobuf_ops, |
810 | .add = pxa_camera_add_device, | ||
811 | .remove = pxa_camera_remove_device, | ||
812 | .msize = sizeof(struct pxa_buffer), | 823 | .msize = sizeof(struct pxa_buffer), |
813 | .set_fmt_cap = pxa_camera_set_fmt_cap, | 824 | .ops = &pxa_soc_camera_host_ops, |
814 | .try_fmt_cap = pxa_camera_try_fmt_cap, | ||
815 | .reqbufs = pxa_camera_reqbufs, | ||
816 | .poll = pxa_camera_poll, | ||
817 | .querycap = pxa_camera_querycap, | ||
818 | .try_bus_param = pxa_camera_try_bus_param, | ||
819 | .set_bus_param = pxa_camera_set_bus_param, | ||
820 | }; | 825 | }; |
821 | 826 | ||
822 | static int pxa_camera_probe(struct platform_device *pdev) | 827 | static int pxa_camera_probe(struct platform_device *pdev) |
@@ -912,7 +917,7 @@ static int pxa_camera_probe(struct platform_device *pdev) | |||
912 | pxa_soc_camera_host.priv = pcdev; | 917 | pxa_soc_camera_host.priv = pcdev; |
913 | pxa_soc_camera_host.dev.parent = &pdev->dev; | 918 | pxa_soc_camera_host.dev.parent = &pdev->dev; |
914 | pxa_soc_camera_host.nr = pdev->id; | 919 | pxa_soc_camera_host.nr = pdev->id; |
915 | err = soc_camera_host_register(&pxa_soc_camera_host, THIS_MODULE); | 920 | err = soc_camera_host_register(&pxa_soc_camera_host); |
916 | if (err) | 921 | if (err) |
917 | goto exit_free_irq; | 922 | goto exit_free_irq; |
918 | 923 | ||