summaryrefslogtreecommitdiff
path: root/qcom
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2020-02-13 19:42:46 +0530
committerJohn Stultz <john.stultz@linaro.org>2020-03-17 04:10:56 +0000
commit8bd2e61f623552eccd2d0b85f140535f219a2279 (patch)
tree62251a127f6051a82925b78ed40ef4b71de9cc15 /qcom
parentd477f821bb485acbb232cb896e06b99ed98ba25c (diff)
db845c: qcom: rmtfs: Keep /dev/qcom_rmtfs_memX fd open
/dev/qcom_rmtfs_mem0 fd is required to share the data. Change-Id: I62a2605cdf699047654f3a0b222be9610bae1085 Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'qcom')
-rw-r--r--qcom/rmtfs/sharedmem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/qcom/rmtfs/sharedmem.c b/qcom/rmtfs/sharedmem.c
index 66bbd5d..fb31720 100644
--- a/qcom/rmtfs/sharedmem.c
+++ b/qcom/rmtfs/sharedmem.c
@@ -211,6 +211,14 @@ static int rmtfs_mem_open_rfsa(struct rmtfs_mem *rmem, int client_id)
errno = 0;
+ snprintf(path, sizeof(path), "/dev/qcom_rmtfs_mem%d", client_id);
+ rmem->fd = open(path, O_RDWR);
+ if (rmem->fd < 0) {
+ saved_errno = errno;
+ fprintf(stderr, "failed to open %s: %s\n", path, strerror(errno));
+ return -saved_errno;
+ }
+
snprintf(path, sizeof(path), "/sys/class/rmtfs/qcom_rmtfs_mem%d/phys_addr", client_id);
fd = open(path, O_RDONLY);
if (fd < 0) {