aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddharth Gupta <[email protected]>2021-06-14 19:21:09 -0700
committerBjorn Andersson <[email protected]>2021-06-23 13:41:11 -0500
commit519346ecabd3c1d5821f076b5df1695ecfabe2f6 (patch)
treefc89e4a499d1a80b4dcbb4207a4090270d8ea09d
parentc6659ee893e29912dd47f4d1d2db810fadf4d8fd (diff)
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 <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
-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;