remoteproc: core: Move validate before device add
We can validate whether the remoteproc is correctly setup before making the cdev_add and device_add calls. This saves us the trouble of cleaning up later on. Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/1623723671-5517-3-git-send-email-sidgup@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
c6659ee893
commit
519346ecab
|
@ -2333,6 +2333,10 @@ int rproc_add(struct rproc *rproc)
|
|||
struct device *dev = &rproc->dev;
|
||||
int ret;
|
||||
|
||||
ret = rproc_validate(rproc);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* add char device for this remoteproc */
|
||||
ret = rproc_char_device_add(rproc);
|
||||
if (ret < 0)
|
||||
|
@ -2342,10 +2346,6 @@ int rproc_add(struct rproc *rproc)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = rproc_validate(rproc);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
dev_info(dev, "%s is available\n", rproc->name);
|
||||
|
||||
/* create debugfs entries */
|
||||
|
|
Loading…
Reference in New Issue