From: Sjur Brændeland <[email protected]>

Verify that firmware name is defined in rproc_add.

Signed-off-by: Sjur Brændeland <[email protected]>
---
 drivers/remoteproc/remoteproc_core.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c 
b/drivers/remoteproc/remoteproc_core.c
index d21f8797..9caf533 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -980,13 +980,6 @@ int rproc_boot(struct rproc *rproc)
                return ret;
        }
 
-       /* loading a firmware is required */
-       if (!rproc->firmware) {
-               dev_err(dev, "%s: no firmware to load\n", __func__);
-               ret = -EINVAL;
-               goto unlock_mutex;
-       }
-
        /* prevent underlying implementation from being removed */
        if (!try_module_get(dev->parent->driver->owner)) {
                dev_err(dev, "%s: can't get owner\n", __func__);
@@ -1122,6 +1115,12 @@ int rproc_add(struct rproc *rproc)
        struct device *dev = &rproc->dev;
        int ret;
 
+       /* loading a firmware is required */
+       if (!rproc->firmware) {
+               dev_err(dev, "%s: no firmware to load\n", __func__);
+               return -EINVAL;
+       }
+
        ret = device_add(dev);
        if (ret < 0)
                return ret;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to