igc: Refactor the igc_power_down_link()
[linux-2.6-microblaze.git] / drivers / remoteproc / remoteproc_virtio.c
index e61d738..dfd3808 100644 (file)
@@ -337,8 +337,7 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
 
        if (rproc->ops->kick == NULL) {
                ret = -EINVAL;
-               dev_err(dev, ".kick method not defined for %s",
-                               rproc->name);
+               dev_err(dev, ".kick method not defined for %s\n", rproc->name);
                goto out;
        }
 
@@ -376,6 +375,18 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
                                goto out;
                        }
                }
+       } else {
+               struct device_node *np = rproc->dev.parent->of_node;
+
+               /*
+                * If we don't have dedicated buffer, just attempt to re-assign
+                * the reserved memory from our parent. A default memory-region
+                * at index 0 from the parent's memory-regions is assigned for
+                * the rvdev dev to allocate from. Failure is non-critical and
+                * the allocations will fall back to global pools, so don't
+                * check return value either.
+                */
+               of_reserved_mem_device_init_by_idx(dev, np, 0);
        }
 
        /* Allocate virtio device */