Browse Source

msm: camera: common: Use pdev name for soc dev name

Having a global variable and using the same for all devices
will overwrite the name of previous device. Use pdev name
to be consistent and helps in debugging logs.

CRs-Fixed: 2901925
Change-Id: I086f3dbd12e720c5e6497355eae40ca242d3d408
Signed-off-by: Pavan Kumar Chilamkurthi <[email protected]>
Pavan Kumar Chilamkurthi 4 years ago
parent
commit
7f750a59f0

+ 2 - 8
drivers/cam_cust/cam_custom_hw_mgr/cam_custom_csid/cam_custom_csid_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -21,8 +21,6 @@
 static struct cam_hw_intf *cam_custom_csid_hw_list[CAM_IFE_CSID_HW_NUM_MAX] = {
 	0, 0, 0, 0};
 
-static char csid_dev_name[16];
-
 static struct cam_ife_csid_core_info cam_custom_csid480_hw_info = {
 	.csid_reg = &cam_custom_csid_480_reg_offset,
 	.sw_version  = CAM_IFE_CSID_VER_1_0,
@@ -64,17 +62,13 @@ static int cam_custom_csid_component_bind(struct device *dev,
 		goto free_hw_info;
 	}
 
-	memset(csid_dev_name, 0, sizeof(csid_dev_name));
-	snprintf(csid_dev_name, sizeof(csid_dev_name),
-		"csid-custom%1u", csid_dev_idx);
-
 	csid_hw_intf->hw_idx = csid_dev_idx;
 	csid_hw_intf->hw_type = CAM_ISP_HW_TYPE_IFE_CSID;
 	csid_hw_intf->hw_priv = csid_hw_info;
 
 	csid_hw_info->soc_info.pdev = pdev;
 	csid_hw_info->soc_info.dev = &pdev->dev;
-	csid_hw_info->soc_info.dev_name = csid_dev_name;
+	csid_hw_info->soc_info.dev_name = pdev->name;
 	csid_hw_info->soc_info.index = csid_dev_idx;
 
 	csid_core_info = (struct cam_ife_csid_core_info  *)match_dev->data;

+ 2 - 9
drivers/cam_cust/cam_custom_hw_mgr/cam_custom_hw1/cam_custom_sub_mod_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -16,8 +16,6 @@
 static struct cam_hw_intf *cam_custom_hw_sub_mod_list
 	[CAM_CUSTOM_SUB_MOD_MAX_INSTANCES] = {0, 0};
 
-static char cam_custom_hw_sub_mod_name[8];
-
 struct cam_custom_device_hw_info cam_custom_hw_info = {
 	.hw_ver = 0x0,
 	.irq_status = 0x0,
@@ -62,14 +60,9 @@ static int cam_custom_hw_sub_mod_component_bind(struct device *dev,
 		goto free_hw_intf;
 	}
 
-	memset(cam_custom_hw_sub_mod_name, 0,
-		sizeof(cam_custom_hw_sub_mod_name));
-	snprintf(cam_custom_hw_sub_mod_name, sizeof(cam_custom_hw_sub_mod_name),
-		"custom_hw%1u", hw_intf->hw_idx);
-
 	hw->soc_info.pdev = pdev;
 	hw->soc_info.dev = &pdev->dev;
-	hw->soc_info.dev_name = cam_custom_hw_sub_mod_name;
+	hw->soc_info.dev_name = pdev->name;
 	hw_intf->hw_priv = hw;
 	hw_intf->hw_ops.get_hw_caps = cam_custom_hw_sub_mod_get_hw_caps;
 	hw_intf->hw_ops.init = cam_custom_hw_sub_mod_init_hw;

+ 2 - 8
drivers/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/platform_device.h>
@@ -19,8 +19,6 @@
 #include "cam_fd_hw_v600.h"
 #include "camera_main.h"
 
-static char fd_dev_name[8];
-
 static int cam_fd_hw_dev_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
 {
@@ -58,14 +56,10 @@ static int cam_fd_hw_dev_component_bind(struct device *dev,
 	fd_hw->core_info = fd_core;
 	fd_hw_intf->hw_idx = hw_idx;
 
-	memset(fd_dev_name, 0, sizeof(fd_dev_name));
-	snprintf(fd_dev_name, sizeof(fd_dev_name),
-		"fd%1u", fd_hw_intf->hw_idx);
-
 	fd_hw->hw_state = CAM_HW_STATE_POWER_DOWN;
 	fd_hw->soc_info.pdev = pdev;
 	fd_hw->soc_info.dev = &pdev->dev;
-	fd_hw->soc_info.dev_name = fd_dev_name;
+	fd_hw->soc_info.dev_name = pdev->name;
 	fd_hw->open_count = 0;
 	mutex_init(&fd_hw->hw_mutex);
 	spin_lock_init(&fd_hw->hw_lock);

+ 2 - 8
drivers/cam_icp/icp_hw/bps_hw/bps_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -26,8 +26,6 @@ static struct cam_bps_device_hw_info cam_bps_hw_info = {
 	.reserved = 0,
 };
 
-static char bps_dev_name[8];
-
 static bool cam_bps_cpas_cb(uint32_t client_handle, void *userdata,
 	struct cam_cpas_irq_data *irq_data)
 {
@@ -109,13 +107,9 @@ static int cam_bps_component_bind(struct device *dev,
 		return -ENOMEM;
 	}
 
-	memset(bps_dev_name, 0, sizeof(bps_dev_name));
-	snprintf(bps_dev_name, sizeof(bps_dev_name),
-		"bps%1u", bps_dev_intf->hw_idx);
-
 	bps_dev->soc_info.pdev = pdev;
 	bps_dev->soc_info.dev = &pdev->dev;
-	bps_dev->soc_info.dev_name = bps_dev_name;
+	bps_dev->soc_info.dev_name = pdev->name;
 	bps_dev_intf->hw_priv = bps_dev;
 	bps_dev_intf->hw_ops.init = cam_bps_init_hw;
 	bps_dev_intf->hw_ops.deinit = cam_bps_deinit_hw;

+ 2 - 8
drivers/cam_icp/icp_hw/ipe_hw/ipe_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -34,8 +34,6 @@ static struct cam_ipe_device_hw_info cam_ipe_hw_info[] = {
 	},
 };
 
-static char ipe_dev_name[8];
-
 int cam_ipe_register_cpas(struct cam_hw_soc_info *soc_info,
 	struct cam_ipe_device_core_info *core_info,
 	uint32_t hw_idx)
@@ -100,13 +98,9 @@ static int cam_ipe_component_bind(struct device *dev,
 		return -ENOMEM;
 	}
 
-	memset(ipe_dev_name, 0, sizeof(ipe_dev_name));
-	snprintf(ipe_dev_name, sizeof(ipe_dev_name),
-		"ipe%1u", ipe_dev_intf->hw_idx);
-
 	ipe_dev->soc_info.pdev = pdev;
 	ipe_dev->soc_info.dev = &pdev->dev;
-	ipe_dev->soc_info.dev_name = ipe_dev_name;
+	ipe_dev->soc_info.dev_name = pdev->name;
 	ipe_dev_intf->hw_priv = ipe_dev;
 	ipe_dev_intf->hw_ops.init = cam_ipe_init_hw;
 	ipe_dev_intf->hw_ops.deinit = cam_ipe_deinit_hw;

+ 2 - 8
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -15,8 +15,6 @@
 static struct cam_hw_intf *cam_ife_csid_hw_list[CAM_IFE_CSID_HW_NUM_MAX] = {
 	0, 0, 0, 0};
 
-static char csid_dev_name[8];
-
 static int cam_ife_csid_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
 {
@@ -53,17 +51,13 @@ static int cam_ife_csid_component_bind(struct device *dev,
 		goto free_hw_info;
 	}
 
-	memset(csid_dev_name, 0, sizeof(csid_dev_name));
-	snprintf(csid_dev_name, sizeof(csid_dev_name),
-		"csid%1u", csid_dev_idx);
-
 	hw_intf->hw_idx = csid_dev_idx;
 	hw_intf->hw_type = CAM_ISP_HW_TYPE_IFE_CSID;
 	hw_intf->hw_priv = hw_info;
 
 	hw_info->soc_info.pdev = pdev;
 	hw_info->soc_info.dev = &pdev->dev;
-	hw_info->soc_info.dev_name = csid_dev_name;
+	hw_info->soc_info.dev_name = pdev->name;
 	hw_info->soc_info.index = csid_dev_idx;
 
 	csid_core_info = (struct cam_ife_csid_core_info  *)match_dev->data;

+ 2 - 6
drivers/cam_isp/isp_hw_mgr/isp_hw/ppi_hw/cam_csid_ppi_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -16,7 +16,6 @@
 
 static struct cam_hw_intf *cam_csid_ppi_hw_list[CAM_CSID_PPI_HW_MAX] = {
 	NULL, NULL, NULL, NULL};
-static char ppi_dev_name[8];
 
 static int cam_ppi_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
@@ -60,9 +59,6 @@ static int cam_ppi_component_bind(struct device *dev,
 		goto free_dev;
 	}
 
-	memset(ppi_dev_name, 0, sizeof(ppi_dev_name));
-	snprintf(ppi_dev_name, sizeof(ppi_dev_name), "ppi%1u", ppi_dev_idx);
-
 	ppi_hw_intf->hw_idx  = ppi_dev_idx;
 	ppi_hw_intf->hw_priv = ppi_hw_info;
 
@@ -76,7 +72,7 @@ static int cam_ppi_component_bind(struct device *dev,
 	ppi_hw_info->core_info         = ppi_dev;
 	ppi_hw_info->soc_info.pdev     = pdev;
 	ppi_hw_info->soc_info.dev      = &pdev->dev;
-	ppi_hw_info->soc_info.dev_name = ppi_dev_name;
+	ppi_hw_info->soc_info.dev_name = pdev->name;
 	ppi_hw_info->soc_info.index    = ppi_dev_idx;
 
 	ppi_hw_data = (struct cam_csid_ppi_hw_info  *)match_dev->data;

+ 2 - 8
drivers/cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -16,8 +16,6 @@
 
 static struct cam_hw_intf *cam_sfe_hw_list[CAM_SFE_HW_NUM_MAX];
 
-static char sfe_dev_name[8];
-
 static int cam_sfe_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
 {
@@ -46,13 +44,9 @@ static int cam_sfe_component_bind(struct device *dev,
 		goto free_sfe_hw_intf;
 	}
 
-	memset(sfe_dev_name, 0, sizeof(sfe_dev_name));
-	snprintf(sfe_dev_name, sizeof(sfe_dev_name),
-		"sfe%1u", sfe_hw_intf->hw_idx);
-
 	sfe_info->soc_info.pdev = pdev;
 	sfe_info->soc_info.dev = &pdev->dev;
-	sfe_info->soc_info.dev_name = sfe_dev_name;
+	sfe_info->soc_info.dev_name = pdev->name;
 	sfe_hw_intf->hw_priv = sfe_info;
 	sfe_hw_intf->hw_ops.get_hw_caps = cam_sfe_get_hw_caps;
 	sfe_hw_intf->hw_ops.init = cam_sfe_init_hw;

+ 2 - 8
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -15,8 +15,6 @@
 static struct cam_hw_intf *cam_tfe_csid_hw_list[CAM_TFE_CSID_HW_NUM_MAX] = {
 	0, 0, 0};
 
-static char csid_dev_name[8];
-
 static int cam_tfe_csid_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
 {
@@ -61,10 +59,6 @@ static int cam_tfe_csid_component_bind(struct device *dev,
 		goto free_dev;
 	}
 
-	memset(csid_dev_name, 0, sizeof(csid_dev_name));
-	snprintf(csid_dev_name, sizeof(csid_dev_name),
-		"csid%1u", csid_dev_idx);
-
 	csid_hw_intf->hw_idx = csid_dev_idx;
 	csid_hw_intf->hw_type = CAM_ISP_HW_TYPE_TFE_CSID;
 	csid_hw_intf->hw_priv = csid_hw_info;
@@ -72,7 +66,7 @@ static int cam_tfe_csid_component_bind(struct device *dev,
 	csid_hw_info->core_info = csid_dev;
 	csid_hw_info->soc_info.pdev = pdev;
 	csid_hw_info->soc_info.dev = &pdev->dev;
-	csid_hw_info->soc_info.dev_name = csid_dev_name;
+	csid_hw_info->soc_info.dev_name = pdev->name;
 	csid_hw_info->soc_info.index = csid_dev_idx;
 
 	csid_hw_data = (struct cam_tfe_csid_hw_info  *)match_dev->data;

+ 2 - 8
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -14,8 +14,6 @@
 
 static struct cam_isp_hw_intf_data  cam_tfe_hw_list[CAM_TFE_HW_NUM_MAX];
 
-static char tfe_dev_name[8];
-
 static int cam_tfe_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
 {
@@ -44,13 +42,9 @@ static int cam_tfe_component_bind(struct device *dev,
 		goto free_tfe_hw_intf;
 	}
 
-	memset(tfe_dev_name, 0, sizeof(tfe_dev_name));
-	snprintf(tfe_dev_name, sizeof(tfe_dev_name),
-		"tfe%1u", tfe_hw_intf->hw_idx);
-
 	tfe_hw->soc_info.pdev = pdev;
 	tfe_hw->soc_info.dev = &pdev->dev;
-	tfe_hw->soc_info.dev_name = tfe_dev_name;
+	tfe_hw->soc_info.dev_name = pdev->name;
 	tfe_hw_intf->hw_priv = tfe_hw;
 	tfe_hw_intf->hw_ops.get_hw_caps = cam_tfe_get_hw_caps;
 	tfe_hw_intf->hw_ops.init = cam_tfe_init_hw;

+ 2 - 8
drivers/cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -15,8 +15,6 @@
 static struct cam_hw_intf *cam_top_tpg_hw_list[CAM_TOP_TPG_HW_NUM_MAX] = {
 	0, 0};
 
-static char tpg_dev_name[8];
-
 static int cam_top_tpg_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
 {
@@ -60,10 +58,6 @@ static int cam_top_tpg_component_bind(struct device *dev,
 		goto free_dev;
 	}
 
-	memset(tpg_dev_name, 0, sizeof(tpg_dev_name));
-	snprintf(tpg_dev_name, sizeof(tpg_dev_name),
-		"tpg%1u", tpg_dev_idx);
-
 	tpg_hw_intf->hw_idx = tpg_dev_idx;
 	tpg_hw_intf->hw_type = CAM_ISP_HW_TYPE_TPG;
 	tpg_hw_intf->hw_priv = hw_info;
@@ -71,7 +65,7 @@ static int cam_top_tpg_component_bind(struct device *dev,
 	hw_info->core_info = tpg_hw;
 	hw_info->soc_info.pdev = pdev;
 	hw_info->soc_info.dev = &pdev->dev;
-	hw_info->soc_info.dev_name = tpg_dev_name;
+	hw_info->soc_info.dev_name = pdev->name;
 	hw_info->soc_info.index = tpg_dev_idx;
 
 	tpg_hw_info = (struct cam_top_tpg_hw_info  *)match_dev->data;

+ 2 - 7
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 
@@ -15,7 +15,6 @@
 #include "cam_debug_util.h"
 
 static  struct cam_isp_hw_intf_data cam_vfe_hw_list[CAM_VFE_HW_NUM_MAX];
-static char vfe_dev_name[8];
 
 static int cam_vfe_component_bind(struct device *dev,
 	struct device *master_dev, void *data)
@@ -45,13 +44,9 @@ static int cam_vfe_component_bind(struct device *dev,
 		goto free_vfe_hw_intf;
 	}
 
-	memset(vfe_dev_name, 0, sizeof(vfe_dev_name));
-	snprintf(vfe_dev_name, sizeof(vfe_dev_name),
-		"vfe%1u", vfe_hw_intf->hw_idx);
-
 	vfe_hw->soc_info.pdev = pdev;
 	vfe_hw->soc_info.dev = &pdev->dev;
-	vfe_hw->soc_info.dev_name = vfe_dev_name;
+	vfe_hw->soc_info.dev_name = pdev->name;
 	vfe_hw_intf->hw_priv = vfe_hw;
 	vfe_hw_intf->hw_ops.get_hw_caps = cam_vfe_get_hw_caps;
 	vfe_hw_intf->hw_ops.init = cam_vfe_init_hw;

+ 2 - 8
drivers/cam_ope/ope_hw_mgr/ope_hw/ope_dev.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -30,8 +30,6 @@ static struct hw_version_reg ope_hw_version_reg = {
 	.hw_ver = 0x0,
 };
 
-static char ope_dev_name[8];
-
 static int cam_ope_init_hw_version(struct cam_hw_soc_info *soc_info,
 	struct cam_ope_device_core_info *core_info)
 {
@@ -140,13 +138,9 @@ static int cam_ope_component_bind(struct device *dev,
 		goto ope_dev_alloc_failed;
 	}
 
-	memset(ope_dev_name, 0, sizeof(ope_dev_name));
-	snprintf(ope_dev_name, sizeof(ope_dev_name),
-		"ope%1u", ope_dev_intf->hw_idx);
-
 	ope_dev->soc_info.pdev = pdev;
 	ope_dev->soc_info.dev = &pdev->dev;
-	ope_dev->soc_info.dev_name = ope_dev_name;
+	ope_dev->soc_info.dev_name = pdev->name;
 	ope_dev_intf->hw_priv = ope_dev;
 	ope_dev_intf->hw_ops.init = cam_ope_init_hw;
 	ope_dev_intf->hw_ops.deinit = cam_ope_deinit_hw;