Merge tag 'net-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / drivers / rpmsg / rpmsg_char.c
index 4bbbacd..2bebc9b 100644 (file)
@@ -127,6 +127,9 @@ static int rpmsg_eptdev_open(struct inode *inode, struct file *filp)
        struct rpmsg_device *rpdev = eptdev->rpdev;
        struct device *dev = &eptdev->dev;
 
+       if (eptdev->ept)
+               return -EBUSY;
+
        get_device(dev);
 
        ept = rpmsg_create_ept(rpdev, rpmsg_ept_cb, eptdev, eptdev->chinfo);
@@ -239,9 +242,9 @@ static ssize_t rpmsg_eptdev_write_iter(struct kiocb *iocb,
        }
 
        if (filp->f_flags & O_NONBLOCK)
-               ret = rpmsg_trysend(eptdev->ept, kbuf, len);
+               ret = rpmsg_trysendto(eptdev->ept, kbuf, len, eptdev->chinfo.dst);
        else
-               ret = rpmsg_send(eptdev->ept, kbuf, len);
+               ret = rpmsg_sendto(eptdev->ept, kbuf, len, eptdev->chinfo.dst);
 
 unlock_eptdev:
        mutex_unlock(&eptdev->ept_lock);
@@ -543,7 +546,7 @@ static struct rpmsg_driver rpmsg_chrdev_driver = {
        },
 };
 
-static int rpmsg_char_init(void)
+static int rpmsg_chrdev_init(void)
 {
        int ret;
 
@@ -569,7 +572,7 @@ static int rpmsg_char_init(void)
 
        return ret;
 }
-postcore_initcall(rpmsg_char_init);
+postcore_initcall(rpmsg_chrdev_init);
 
 static void rpmsg_chrdev_exit(void)
 {