rpmsg: core: Make remove handler for rpmsg driver optional.

Most other bus (for example, SPI, i2c) have the remove handler for
driver optional. Make remove handler for rpmsg driver optional too.

Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Pi-Hsun Shih 2019-01-07 19:38:32 +08:00 committed by Bjorn Andersson
parent b270ea40b3
commit 54119bc111

View File

@ -493,7 +493,8 @@ static int rpmsg_dev_remove(struct device *dev)
if (rpdev->ops->announce_destroy)
err = rpdev->ops->announce_destroy(rpdev);
rpdrv->remove(rpdev);
if (rpdrv->remove)
rpdrv->remove(rpdev);
dev_pm_domain_detach(dev, true);