diff options
Diffstat (limited to 'drivers/rpmsg/rpmsg_char.c')
-rw-r--r-- | drivers/rpmsg/rpmsg_char.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index 4f2189111494..3e0b8f3496ed 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c @@ -76,7 +76,9 @@ int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data) mutex_lock(&eptdev->ept_lock); if (eptdev->ept) { - rpmsg_destroy_ept(eptdev->ept); + /* The default endpoint is released by the rpmsg core */ + if (!eptdev->default_ept) + rpmsg_destroy_ept(eptdev->ept); eptdev->ept = NULL; } mutex_unlock(&eptdev->ept_lock); @@ -424,15 +426,12 @@ int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent struct rpmsg_channel_info chinfo) { struct rpmsg_eptdev *eptdev; - int ret; eptdev = rpmsg_chrdev_eptdev_alloc(rpdev, parent); if (IS_ERR(eptdev)) return PTR_ERR(eptdev); - ret = rpmsg_chrdev_eptdev_add(eptdev, chinfo); - - return ret; + return rpmsg_chrdev_eptdev_add(eptdev, chinfo); } EXPORT_SYMBOL(rpmsg_chrdev_eptdev_create); |