[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1623783824-13395-3-git-send-email-sidgup@codeaurora.org>
Date: Tue, 15 Jun 2021 12:03:42 -0700
From: Siddharth Gupta <sidgup@...eaurora.org>
To: bjorn.andersson@...aro.org, ohad@...ery.com,
linux-remoteproc@...r.kernel.org
Cc: Siddharth Gupta <sidgup@...eaurora.org>,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, psodagud@...eaurora.org,
stable@...r.kernel.org
Subject: [PATCH v4 2/4] 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@...eaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: stable@...r.kernel.org
---
drivers/remoteproc/remoteproc_core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 9ad8c5f..b65fce3 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;
--
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists