@@ -892,6 +892,7 @@ rproc_mem_entry_init(struct device *dev,
if (!mem)
return mem;
+ mem->dev = dev;
mem->va = va;
mem->dma = dma;
mem->da = da;
@@ -932,6 +933,7 @@ rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, int len,
if (!mem)
return mem;
+ mem->dev = dev;
mem->da = da;
mem->len = len;
mem->rsc_offset = FW_RSC_ADDR_ANY;
@@ -439,7 +439,7 @@ static int rproc_vitio_start(struct rproc_subdev *subdev)
phys_addr_t pa;
if (mem->of_resm_idx != -1) {
- struct device_node *np = rproc->dev.parent->of_node;
+ struct device_node *np = mem->dev->of_node;
/* Associate reserved memory to vdev device */
ret = of_reserved_mem_device_init_by_idx(dev, np,
@@ -331,6 +331,7 @@ struct rproc_mem_entry {
dma_addr_t dma;
int len;
u32 da;
+ struct device *dev;
void *priv;
char name[32];
struct list_head node;
mem entry could be registered at different levels, platform driver or virtio device itself. Add device information in rproc_mem_entry struct to retrieve a memory region registered by another device. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> --- drivers/remoteproc/remoteproc_core.c | 2 ++ drivers/remoteproc/remoteproc_virtio.c | 2 +- include/linux/remoteproc.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)