Skip to content

Commit 519346e

Browse files
Siddharth Guptaandersson
authored andcommitted
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>
1 parent c6659ee commit 519346e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/remoteproc/remoteproc_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,16 +2333,16 @@ int rproc_add(struct rproc *rproc)
23332333
struct device *dev = &rproc->dev;
23342334
int ret;
23352335

2336-
/* add char device for this remoteproc */
2337-
ret = rproc_char_device_add(rproc);
2336+
ret = rproc_validate(rproc);
23382337
if (ret < 0)
23392338
return ret;
23402339

2341-
ret = device_add(dev);
2340+
/* add char device for this remoteproc */
2341+
ret = rproc_char_device_add(rproc);
23422342
if (ret < 0)
23432343
return ret;
23442344

2345-
ret = rproc_validate(rproc);
2345+
ret = device_add(dev);
23462346
if (ret < 0)
23472347
return ret;
23482348

0 commit comments

Comments
 (0)