diff options
author | Loic Pallardy <loic.pallardy@st.com> | 2019-01-10 08:50:51 -0500 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2019-02-21 00:15:49 -0500 |
commit | d999b622fcfb392aa549e7e56f6f777b09748ea1 (patch) | |
tree | b14a36f5d5392292f623de575f81e0f546187014 /drivers/rpmsg | |
parent | 3df52ed7f269a25a5f97d6c03887c3ad3d012816 (diff) |
rpmsg: virtio: allocate buffer from parent
Remoteproc is now capable to create one specific sub-device per
virtio link to associate a dedicated memory pool.
This implies to change device used by virtio_rpmsg for
buffer allocation from grand-parent to parent.
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r-- | drivers/rpmsg/virtio_rpmsg_bus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 664f957012cd..5c892019ce89 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c | |||
@@ -912,7 +912,7 @@ static int rpmsg_probe(struct virtio_device *vdev) | |||
912 | total_buf_space = vrp->num_bufs * vrp->buf_size; | 912 | total_buf_space = vrp->num_bufs * vrp->buf_size; |
913 | 913 | ||
914 | /* allocate coherent memory for the buffers */ | 914 | /* allocate coherent memory for the buffers */ |
915 | bufs_va = dma_alloc_coherent(vdev->dev.parent->parent, | 915 | bufs_va = dma_alloc_coherent(vdev->dev.parent, |
916 | total_buf_space, &vrp->bufs_dma, | 916 | total_buf_space, &vrp->bufs_dma, |
917 | GFP_KERNEL); | 917 | GFP_KERNEL); |
918 | if (!bufs_va) { | 918 | if (!bufs_va) { |
@@ -980,7 +980,7 @@ static int rpmsg_probe(struct virtio_device *vdev) | |||
980 | return 0; | 980 | return 0; |
981 | 981 | ||
982 | free_coherent: | 982 | free_coherent: |
983 | dma_free_coherent(vdev->dev.parent->parent, total_buf_space, | 983 | dma_free_coherent(vdev->dev.parent, total_buf_space, |
984 | bufs_va, vrp->bufs_dma); | 984 | bufs_va, vrp->bufs_dma); |
985 | vqs_del: | 985 | vqs_del: |
986 | vdev->config->del_vqs(vrp->vdev); | 986 | vdev->config->del_vqs(vrp->vdev); |
@@ -1015,7 +1015,7 @@ static void rpmsg_remove(struct virtio_device *vdev) | |||
1015 | 1015 | ||
1016 | vdev->config->del_vqs(vrp->vdev); | 1016 | vdev->config->del_vqs(vrp->vdev); |
1017 | 1017 | ||
1018 | dma_free_coherent(vdev->dev.parent->parent, total_buf_space, | 1018 | dma_free_coherent(vdev->dev.parent, total_buf_space, |
1019 | vrp->rbufs, vrp->bufs_dma); | 1019 | vrp->rbufs, vrp->bufs_dma); |
1020 | 1020 | ||
1021 | kfree(vrp); | 1021 | kfree(vrp); |