mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petlozu Pravareshwar <petlozup@nvidia.com>
To: <jonathanh@nvidia.com>, <thierry.reding@gmail.com>,
	<p.zabel@pengutronix.de>, <dmitry.osipenko@collabora.com>,
	<ulf.hansson@linaro.org>, <kkartik@nvidia.com>,
	<cai.huoqing@linux.dev>, <spatra@nvidia.com>,
	<linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <petlozup@nvidia.com>, Manish Bhardwaj <mbhardwaj@nvidia.com>
Subject: [PATCH] soc/tegra: pmc: Check device node status property
Date: Tue, 6 Sep 2022 13:51:17 +0000	[thread overview]
Message-ID: <20220906135117.341529-1-petlozup@nvidia.com> (raw)

In early_initcall, check if PMC device is available for use
and avoid accessing PMC resources if the device node status
property is set to disabled.

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
---
 drivers/soc/tegra/pmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 6a86961477e8..8c7b46ac6ad6 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -4295,7 +4295,7 @@ static int __init tegra_pmc_early_init(void)
 		return -ENXIO;
 	}
 
-	if (np) {
+	if (of_device_is_available(np)) {
 		pmc->soc = match->data;
 
 		if (pmc->soc->maybe_tz_only)
-- 
2.17.1


             reply	other threads:[~2022-09-06 14:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 13:51 Petlozu Pravareshwar [this message]
2022-09-15 12:11 ` Thierry Reding

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=20220906135117.341529-1-petlozup@nvidia.com \
    --to=petlozup@nvidia.com \
    --cc=cai.huoqing@linux.dev \
    --cc=dmitry.osipenko@collabora.com \
    --cc=jonathanh@nvidia.com \
    --cc=kkartik@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mbhardwaj@nvidia.com \
    --cc=p.zabel@pengutronix.de \
    --cc=spatra@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.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®