]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commitdiff
rpmsg: char: Update local endpt address for virtio-rpmsg backend rpmsg-linux-5.4.y
authorSuman Anna <s-anna@ti.com>
Tue, 15 Sep 2020 00:13:52 +0000 (19:13 -0500)
committerSuman Anna <s-anna@ti.com>
Mon, 12 Oct 2020 15:24:27 +0000 (10:24 -0500)
The rpmsg char driver creates a local end-point when the actual endpt
device is opened. The virtio-rpmsg backend can dynamically allocate the
local end-point address if the endpt creation is done using the address
RPMSG_ADDR_ANY. This is not reflected in the sysfs src file, so update
the stored address with the allocated address in such a case. This
allows the userspace to be able to retrieve the local end-point address
through sysfs.

Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/rpmsg/rpmsg_char.c

index f682df13bb6384b87ddd778bc1170949e2881cfe..4c6d284702a76d1b853f279ac7f1b966ebb15b77 100644 (file)
@@ -137,6 +137,8 @@ static int rpmsg_eptdev_open(struct inode *inode, struct file *filp)
        }
 
        eptdev->ept = ept;
+       if (eptdev->chinfo.src == RPMSG_ADDR_ANY)
+               eptdev->chinfo.src = ept->addr;
        filp->private_data = eptdev;
 
        return 0;