summaryrefslogtreecommitdiff
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorSiddharth Gupta <sidgup@codeaurora.org>2021-06-14 19:21:09 -0700
committerBjorn Andersson <bjorn.andersson@linaro.org>2021-06-23 13:41:11 -0500
commit519346ecabd3c1d5821f076b5df1695ecfabe2f6 (patch)
treefc89e4a499d1a80b4dcbb4207a4090270d8ea09d /drivers/remoteproc
parentc6659ee893e29912dd47f4d1d2db810fadf4d8fd (diff)
downloadlwn-519346ecabd3c1d5821f076b5df1695ecfabe2f6.tar.gz
lwn-519346ecabd3c1d5821f076b5df1695ecfabe2f6.zip
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>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc_core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 9ad8c5f96500..b65fce32e88c 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -2333,16 +2333,16 @@ int rproc_add(struct rproc *rproc)
struct device *dev = &rproc->dev;
int ret;
- /* add char device for this remoteproc */
- ret = rproc_char_device_add(rproc);
+ ret = rproc_validate(rproc);
if (ret < 0)
return ret;
- ret = device_add(dev);
+ /* add char device for this remoteproc */
+ ret = rproc_char_device_add(rproc);
if (ret < 0)
return ret;
- ret = rproc_validate(rproc);
+ ret = device_add(dev);
if (ret < 0)
return ret;