diff options
author | Josh Kergan <jkergan@nvidia.com> | 2017-10-24 21:31:28 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-27 15:26:12 -0400 |
commit | c04513ee6f787a70c9cc839117918e92e38ae9ff (patch) | |
tree | 41e315898c2741590687051a061d1f5ab64fd259 /drivers/media/spi/imx204.c | |
parent | 79adc1dea8c7224468e60bf76e7410c613bb619e (diff) |
drivers:camera: Update cameras to use common init
All cameras were doing the same setup and cleanup. This common
code was moved to camera_common and now all cameras should behave
the same after probe finishes.
JIRA CHWI-1369
Change-Id: If45351cf051e08015d2edb118a0ee2d1630a72da
Signed-off-by: Josh Kergan <jkergan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585024
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/media/spi/imx204.c')
-rw-r--r-- | drivers/media/spi/imx204.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/media/spi/imx204.c b/drivers/media/spi/imx204.c index 19c84bc5a..c42e02b2a 100644 --- a/drivers/media/spi/imx204.c +++ b/drivers/media/spi/imx204.c | |||
@@ -681,7 +681,6 @@ static int imx204_probe(struct spi_device *spi) | |||
681 | struct camera_common_data *common_data; | 681 | struct camera_common_data *common_data; |
682 | struct imx204 *priv; | 682 | struct imx204 *priv; |
683 | struct device_node *node = spi->dev.of_node; | 683 | struct device_node *node = spi->dev.of_node; |
684 | char debugfs_name[10]; | ||
685 | int err; | 684 | int err; |
686 | int ret = 0; | 685 | int ret = 0; |
687 | 686 | ||
@@ -765,15 +764,9 @@ static int imx204_probe(struct spi_device *spi) | |||
765 | if (err) | 764 | if (err) |
766 | return err; | 765 | return err; |
767 | 766 | ||
768 | err = camera_common_parse_ports(&spi->dev, common_data); | 767 | err = camera_common_initialize(common_data, "imx204"); |
769 | if (err) { | 768 | if (err) |
770 | dev_err(&spi->dev, "Failed to find port info\n"); | ||
771 | return err; | 769 | return err; |
772 | } | ||
773 | |||
774 | sprintf(debugfs_name, "imx204_%c", common_data->csi_port + 'a'); | ||
775 | dev_dbg(&spi->dev, "%s: name %s\n", __func__, debugfs_name); | ||
776 | camera_common_create_debugfs(common_data, "imx204"); | ||
777 | 770 | ||
778 | v4l2_spi_subdev_init(&common_data->subdev, spi, &imx204_subdev_ops); | 771 | v4l2_spi_subdev_init(&common_data->subdev, spi, &imx204_subdev_ops); |
779 | 772 | ||
@@ -821,7 +814,7 @@ imx204_remove(struct spi_device *spi) | |||
821 | #endif | 814 | #endif |
822 | v4l2_ctrl_handler_free(&priv->ctrl_handler); | 815 | v4l2_ctrl_handler_free(&priv->ctrl_handler); |
823 | imx204_power_put(priv); | 816 | imx204_power_put(priv); |
824 | camera_common_remove_debugfs(s_data); | 817 | camera_common_cleanup(s_data); |
825 | 818 | ||
826 | return 0; | 819 | return 0; |
827 | } | 820 | } |