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

Commit 7c8a25a1 authored by David Collins's avatar David Collins
Browse files

regulator: cprh-kbss-regulator: initialize fuse_corner_count before use



Initialize the vreg->fuse_corner_count variable before calling
cprh_sdm845_kbss_read_fuse_data() which depends upon it.  This
ensures that correct fuse values are read instead of being
skipped and left at a default value of 0.

Change-Id: Ie04729c5c234cf098858267f55d094d3d156f505
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 13ce0881
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -983,6 +983,9 @@ static int cprh_kbss_read_fuse_data(struct cpr3_regulator *vreg)
		return -EINVAL;
		return -EINVAL;
	}
	}


	vreg->fuse_corner_count = fuse_corners;
	vreg->platform_fuses = fuse;

	fuse->ro_sel = devm_kcalloc(vreg->thread->ctrl->dev, fuse_corners,
	fuse->ro_sel = devm_kcalloc(vreg->thread->ctrl->dev, fuse_corners,
			sizeof(*fuse->ro_sel), GFP_KERNEL);
			sizeof(*fuse->ro_sel), GFP_KERNEL);
	fuse->init_voltage = devm_kcalloc(vreg->thread->ctrl->dev, fuse_corners,
	fuse->init_voltage = devm_kcalloc(vreg->thread->ctrl->dev, fuse_corners,
@@ -1037,8 +1040,6 @@ static int cprh_kbss_read_fuse_data(struct cpr3_regulator *vreg)


	vreg->speed_bin_fuse	= fuse->speed_bin;
	vreg->speed_bin_fuse	= fuse->speed_bin;
	vreg->cpr_rev_fuse	= fuse->cpr_fusing_rev;
	vreg->cpr_rev_fuse	= fuse->cpr_fusing_rev;
	vreg->fuse_corner_count	= fuse_corners;
	vreg->platform_fuses	= fuse;


	return 0;
	return 0;
}
}