Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a865a851 authored by Andy Sun's avatar Andy Sun
Browse files

ais: fix getting vfe regulators number bug



The original method of getting array member size is wrong.
Considerating vfe_dev->hw_info is set during runtime, so set the number
statically.

Change-Id: I90a2fb19948409b22ed219ba8ec8bc4deb4f0a46
Signed-off-by: default avatarAndy Sun <bins@codeaurora.org>
parent 03f28c16
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@ struct msm_vfe_hardware_info {
	uint32_t dmi_reg_offset;
	uint32_t min_ab;
	uint32_t min_ib;
	uint32_t regulator_num;
	const char *regulator_names[];
};

+2 −2
Original line number Diff line number Diff line
@@ -2537,8 +2537,7 @@ int msm_vfe47_get_regulators(struct vfe_device *vfe_dev)
	int rc = 0;
	int i;

	vfe_dev->vfe_num_regulators =
		sizeof(*vfe_dev->hw_info->regulator_names) / sizeof(char *);
	vfe_dev->vfe_num_regulators = vfe_dev->hw_info->regulator_num;

	vfe_dev->regulator_info = kzalloc(sizeof(struct msm_cam_regulator) *
				vfe_dev->vfe_num_regulators, GFP_KERNEL);
@@ -2811,6 +2810,7 @@ struct msm_vfe_hardware_info vfe47_hw_info = {
	.dmi_reg_offset = 0xC2C,
	.axi_hw_info = &msm_vfe47_axi_hw_info,
	.stats_hw_info = &msm_vfe47_stats_hw_info,
	.regulator_num = 3,
	.regulator_names = {"vdd", "camss-vdd", "mmagic-vdd"},
};
EXPORT_SYMBOL(vfe47_hw_info);