Skip to content

Commit

Permalink
rpmsg: fix dma_free_coherent dev parameter
Browse files Browse the repository at this point in the history
dma_alloc/free_coherent APIs requires the platform specific remoteproc
device as the device parameter. We are passing vdev->dev.parent to the
dma_free_coherent function which is the generic rproc device and it is
wrong, it has to be vdev->dev.parent->parent instead, same as when we
call dma_alloc_coherent function.

Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
  • Loading branch information
Fernando Guzman Lugo authored and Ohad Ben-Cohen committed Sep 12, 2012
1 parent 55d512e commit eeb0074
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/rpmsg/virtio_rpmsg_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,8 @@ static int rpmsg_probe(struct virtio_device *vdev)
return 0;

free_coherent:
dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, bufs_va,
vrp->bufs_dma);
dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE,
bufs_va, vrp->bufs_dma);
vqs_del:
vdev->config->del_vqs(vrp->vdev);
free_vrp:
Expand Down Expand Up @@ -1043,7 +1043,7 @@ static void __devexit rpmsg_remove(struct virtio_device *vdev)

vdev->config->del_vqs(vrp->vdev);

dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE,
dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE,
vrp->rbufs, vrp->bufs_dma);

kfree(vrp);
Expand Down

0 comments on commit eeb0074

Please sign in to comment.