]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/rpmsg/rpmsg_core.c
Merge tag 'trace-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux.git] / drivers / rpmsg / rpmsg_core.c
index b714a543a91d93c8fff11766fcd867c7bc8a1a68..8122807db380949b44624866a9403ddbc0569d15 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/rpmsg.h>
 #include <linux/of_device.h>
+#include <linux/pm_domain.h>
 #include <linux/slab.h>
 
 #include "rpmsg_internal.h"
@@ -449,6 +450,10 @@ static int rpmsg_dev_probe(struct device *dev)
        struct rpmsg_endpoint *ept = NULL;
        int err;
 
+       err = dev_pm_domain_attach(dev, true);
+       if (err)
+               goto out;
+
        if (rpdrv->callback) {
                strncpy(chinfo.name, rpdev->id.name, RPMSG_NAME_SIZE);
                chinfo.src = rpdev->src;
@@ -490,6 +495,8 @@ static int rpmsg_dev_remove(struct device *dev)
 
        rpdrv->remove(rpdev);
 
+       dev_pm_domain_detach(dev, true);
+
        if (rpdev->ept)
                rpmsg_destroy_ept(rpdev->ept);