virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 4/4] virtio_remoteproc: correct put_device virtio_device.dev
@ 2017-12-21 12:40 weiping zhang
  2017-12-22 13:40 ` Cornelia Huck
  2018-01-02 17:34 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: weiping zhang @ 2017-12-21 12:40 UTC (permalink / raw)
  To: cohuck, ohad, bjorn.andersson, mst, jasowang; +Cc: virtualization

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.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
---
 drivers/remoteproc/remoteproc_virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index 2946348..b0633fd 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -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;
 	}
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v5 4/4] virtio_remoteproc: correct put_device virtio_device.dev
  2017-12-21 12:40 [PATCH v5 4/4] virtio_remoteproc: correct put_device virtio_device.dev weiping zhang
@ 2017-12-22 13:40 ` Cornelia Huck
  2018-01-02 17:34 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2017-12-22 13:40 UTC (permalink / raw)
  To: weiping zhang; +Cc: mst, virtualization, bjorn.andersson

On Thu, 21 Dec 2017 20:40:58 +0800
weiping zhang <zhangweiping@didichuxing.com> wrote:

> 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.
> 
> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
> ---
>  drivers/remoteproc/remoteproc_virtio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v5 4/4] virtio_remoteproc: correct put_device virtio_device.dev
  2017-12-21 12:40 [PATCH v5 4/4] virtio_remoteproc: correct put_device virtio_device.dev weiping zhang
  2017-12-22 13:40 ` Cornelia Huck
@ 2018-01-02 17:34 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2018-01-02 17:34 UTC (permalink / raw)
  To: weiping zhang; +Cc: cohuck, virtualization, mst

On Thu 21 Dec 04:40 PST 2017, weiping zhang wrote:

> 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.
> 
> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>

Thanks weiping and Cornelia, applied.

Regards,
Bjorn

> ---
>  drivers/remoteproc/remoteproc_virtio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
> index 2946348..b0633fd 100644
> --- a/drivers/remoteproc/remoteproc_virtio.c
> +++ b/drivers/remoteproc/remoteproc_virtio.c
> @@ -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;
>  	}
> -- 
> 2.9.4
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-02 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21 12:40 [PATCH v5 4/4] virtio_remoteproc: correct put_device virtio_device.dev weiping zhang
2017-12-22 13:40 ` Cornelia Huck
2018-01-02 17:34 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).