Skip to contentSkip to conversation

virtio_remoteproc: correct put_device virtio_device.dev

PATCH In review weiping zhang 3 participants 3 messages Dec 21, 2017 – Jan 2, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v5 4/4 virtio_remoteproc: correct put_device virtio_device.dev

rproc_virtio_dev_release will be called iff virtio_device.dev's reference count drops to 0. Here we just put vdev.dev, and then rproc->dev's cleanup will be done in rproc_virtio_dev_release.

---
 drivers/remoteproc/remoteproc_virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/remoteproc_virtio.c +1 -1
index 2946348..b0633fd 100644
@@ -327,7 +327,7 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
 
 	ret = register_virtio_device(vdev);
 	if (ret) {
-		put_device(&rproc->dev);
+		put_device(&vdev->dev);
 		dev_err(dev, "failed to register vdev: %d\n", ret);
 		goto out;
 	}
Signature · 1 line
2.9.4
Reviewed-by on v5 4/4
#1 lore raw
Quoted 8 lines · On Thu, 21 Dec 2017 20:40:58 +0800 weiping zhang…

rproc_virtio_dev_release will be called iff virtio_device.dev's reference count drops to 0. Here we just put vdev.dev, and then rproc->dev's cleanup will be done in rproc_virtio_dev_release.

---
 drivers/remoteproc/remoteproc_virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw
In reply to weiping zhang
Quoted 5 lines · weiping zhang

rproc_virtio_dev_release will be called iff virtio_device.dev's reference count drops to 0. Here we just put vdev.dev, and then rproc->dev's cleanup will be done in rproc_virtio_dev_release.

Thanks weiping and Cornelia, applied.

Regards,
Bjorn

Quoted 20 lines
---
 drivers/remoteproc/remoteproc_virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/remoteproc_virtio.c +1 -1
index 2946348..b0633fd 100644
@@ -327,7 +327,7 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
 
 	ret = register_virtio_device(vdev);
 	if (ret) {
-		put_device(&rproc->dev);
+		put_device(&vdev->dev);
 		dev_err(dev, "failed to register vdev: %d\n", ret);
 		goto out;
 	}
Signature · 1 line
2.9.4