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

Commit a0e89a86 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: fg-memif: Fix incorrect usage of error return value



'Commit ac85d987
("power: fg-memif: Modify FG SRAM access configuration over DMA")'
made changes to fix the order of DMA request and release but it
bought in an incorrect usage of error return value.

While doing SRAM access over DMA, if there is an error, DMA
should be released. "ret" is used to hold the error return
value of fg_direct_mem_release() so that the previous error
return value if any can be retained in "rc" and returned back.

Fix it.

Change-Id: Id3e9f1ec4bd3ae00a76399923e9e8d3f225f5bf4
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 55e5efd5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1076,7 +1076,7 @@ static int __fg_direct_mem_rw(struct fg_dev *fg, u16 sram_addr, u8 offset,
		offset = 0;
	}

	rc = fg_direct_mem_release(fg);
	ret = fg_direct_mem_release(fg);
	if (ret < 0) {
		pr_err("Error in releasing direct_mem access rc=%d\n", rc);
		return ret;