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

Commit 603c54fd authored by Lina Iyer's avatar Lina Iyer
Browse files

drivers: qcom: rpmh-rsc: check for control TCS availablilty



Write the PDC data only if the RSC allow writing to the control TCS.

Change-Id: I7795773075a563c939f41dc8f389d618120ec7e0
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 1fa28c49
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -642,9 +642,11 @@ int rpmh_rsc_write_pdc_data(struct rsc_drv *drv, const struct tcs_request *msg)
{
	int i;
	void __iomem *addr = drv->base + RSC_PDC_DRV_DATA;
	struct tcs_group *tcs = get_tcs_of_type(drv, CONTROL_TCS);
	struct tcs_cmd *cmd;

	if (!msg || !msg->cmds || msg->num_cmds != RSC_PDC_DATA_SIZE)
	if (!msg || !msg->cmds || msg->num_cmds != RSC_PDC_DATA_SIZE ||
	    !tcs->num_tcs)
		return -EINVAL;

	for (i = 0; i < msg->num_cmds; i++) {