Message ID | 1621284349-22752-3-git-send-email-sidgup@codeaurora.org |
---|---|
State | Superseded |
Headers | show |
Series | remoteproc: core: Fixes for rproc cdev and add | expand |
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 562355a..45d09bf 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2316,16 +2316,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;
We can validate whether the remoteproc is correctly setup before calling 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> --- drivers/remoteproc/remoteproc_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)