mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Loys Ollivier <lollivier@baylibre.com>
To: Andy Gross <andy.gross@linaro.org>, David Brown <david.brown@linaro.org>
Cc: Loys Ollivier <lollivier@baylibre.com>,
	linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org,
	Jerome Brunet <jbrunet@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>
Subject: [PATCH v3] firmware: qcom: scm: Fix incorrect of_node_put calls in scm_init
Date: Fri, 15 Dec 2017 14:40:14 +0100	[thread overview]
Message-ID: <1513345214-22835-1-git-send-email-lollivier@baylibre.com> (raw)

When using other platform architectures, in the init of the qcom_scm
driver, of_node_put is called on /firmware if no qcom dt is found.
This results in a kernel error: Bad of_node_put() on /firmware.

These calls to of_node_put from the qcom_scm init are unnecessary as
of_find_matching_node and of_platform_populate are calling it
automatically.

Remove the calls to of_node_put() on fw_np.

Fixes: d0f6fa7ba2d6 ("firmware: qcom: scm: Convert SCM to platform driver")
Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
---
 drivers/firmware/qcom_scm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index af4c75217ea6..f6d7b7cffe0c 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -632,17 +632,13 @@ static int __init qcom_scm_init(void)
 
 	np = of_find_matching_node(fw_np, qcom_scm_dt_match);
 
-	if (!np) {
-		of_node_put(fw_np);
+	if (!np)
 		return -ENODEV;
-	}
 
 	of_node_put(np);
 
 	ret = of_platform_populate(fw_np, qcom_scm_dt_match, NULL, NULL);
 
-	of_node_put(fw_np);
-
 	if (ret)
 		return ret;
 
-- 
2.7.4

             reply	other threads:[~2017-12-15 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 13:40 Loys Ollivier [this message]
2018-01-15 13:25 ` Loys Ollivier
2018-01-16 16:45 ` Bjorn Andersson
2018-01-16 17:41   ` Sudeep Holla
2018-01-17 23:47   ` Andy Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513345214-22835-1-git-send-email-lollivier@baylibre.com \
    --to=lollivier@baylibre.com \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=jbrunet@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®