diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-04-24 11:55:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:43 -0400 |
commit | eb6c8558f7658b7f31ee022c7bea1d840eda33dc (patch) | |
tree | cd04ace1cfe7c03329d0e610b296c3d4250544f2 /drivers/media/video/mx1_camera.c | |
parent | 594bb46dbc63934bc65fa95743f83204bd26a641 (diff) |
V4L/DVB (11608): soc-camera: host-driver cleanup
Embed struct soc_camera_host in platform-specific per host instance objects
instead of allocating them statically in drivers, use platform_[gs]et_drvdata
consistently, use resource_size().
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mx1_camera.c')
-rw-r--r-- | drivers/media/video/mx1_camera.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c index 86fab56c5a20..48dd984dadff 100644 --- a/drivers/media/video/mx1_camera.c +++ b/drivers/media/video/mx1_camera.c | |||
@@ -102,6 +102,7 @@ struct mx1_buffer { | |||
102 | * Interface. If anyone ever builds hardware to enable more than | 102 | * Interface. If anyone ever builds hardware to enable more than |
103 | * one camera, they will have to modify this driver too */ | 103 | * one camera, they will have to modify this driver too */ |
104 | struct mx1_camera_dev { | 104 | struct mx1_camera_dev { |
105 | struct soc_camera_host soc_host; | ||
105 | struct soc_camera_device *icd; | 106 | struct soc_camera_device *icd; |
106 | struct mx1_camera_pdata *pdata; | 107 | struct mx1_camera_pdata *pdata; |
107 | struct mx1_buffer *active; | 108 | struct mx1_buffer *active; |
@@ -633,12 +634,6 @@ static struct soc_camera_host_ops mx1_soc_camera_host_ops = { | |||
633 | .querycap = mx1_camera_querycap, | 634 | .querycap = mx1_camera_querycap, |
634 | }; | 635 | }; |
635 | 636 | ||
636 | /* Should be allocated dynamically too, but we have only one. */ | ||
637 | static struct soc_camera_host mx1_soc_camera_host = { | ||
638 | .drv_name = DRIVER_NAME, | ||
639 | .ops = &mx1_soc_camera_host_ops, | ||
640 | }; | ||
641 | |||
642 | static struct fiq_handler fh = { | 637 | static struct fiq_handler fh = { |
643 | .name = "csi_sof" | 638 | .name = "csi_sof" |
644 | }; | 639 | }; |
@@ -673,7 +668,7 @@ static int __init mx1_camera_probe(struct platform_device *pdev) | |||
673 | goto exit_put_clk; | 668 | goto exit_put_clk; |
674 | } | 669 | } |
675 | 670 | ||
676 | dev_set_drvdata(&pdev->dev, pcdev); | 671 | platform_set_drvdata(pdev, pcdev); |
677 | pcdev->res = res; | 672 | pcdev->res = res; |
678 | pcdev->clk = clk; | 673 | pcdev->clk = clk; |
679 | 674 | ||
@@ -746,10 +741,12 @@ static int __init mx1_camera_probe(struct platform_device *pdev) | |||
746 | mxc_set_irq_fiq(irq, 1); | 741 | mxc_set_irq_fiq(irq, 1); |
747 | enable_fiq(irq); | 742 | enable_fiq(irq); |
748 | 743 | ||
749 | mx1_soc_camera_host.priv = pcdev; | 744 | pcdev->soc_host.drv_name = DRIVER_NAME; |
750 | mx1_soc_camera_host.dev.parent = &pdev->dev; | 745 | pcdev->soc_host.ops = &mx1_soc_camera_host_ops; |
751 | mx1_soc_camera_host.nr = pdev->id; | 746 | pcdev->soc_host.priv = pcdev; |
752 | err = soc_camera_host_register(&mx1_soc_camera_host); | 747 | pcdev->soc_host.dev.parent = &pdev->dev; |
748 | pcdev->soc_host.nr = pdev->id; | ||
749 | err = soc_camera_host_register(&pcdev->soc_host); | ||
753 | if (err) | 750 | if (err) |
754 | goto exit_free_irq; | 751 | goto exit_free_irq; |
755 | 752 | ||
@@ -787,7 +784,7 @@ static int __exit mx1_camera_remove(struct platform_device *pdev) | |||
787 | 784 | ||
788 | clk_put(pcdev->clk); | 785 | clk_put(pcdev->clk); |
789 | 786 | ||
790 | soc_camera_host_unregister(&mx1_soc_camera_host); | 787 | soc_camera_host_unregister(&pcdev->soc_host); |
791 | 788 | ||
792 | iounmap(pcdev->base); | 789 | iounmap(pcdev->base); |
793 | 790 | ||