Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Kartik Rajput <kkartik@nvidia.com>,
	thierry.reding@kernel.org, kees@kernel.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] soc/tegra: fuse: Use device-specific instance in suspend/resume
Date: Thu, 14 May 2026 09:03:27 +0100	[thread overview]
Message-ID: <2a75a688-2bd8-4f74-83cd-7da80538795e@nvidia.com> (raw)
In-Reply-To: <20260514053518.2402597-1-kkartik@nvidia.com>



On 14/05/2026 06:35, Kartik Rajput wrote:
> Avoid using the default fuse instance in suspend/resume callbacks, as it
> always runs the suspend/resume callbacks for the default instance rather
> than the device’s own.
> 
> Get the correct fuse instance by using `dev_get_drvdata()`.
> 
> Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
> ---
>   drivers/soc/tegra/fuse/fuse-tegra.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
> index 291484595dcf..f38107d04ed6 100644
> --- a/drivers/soc/tegra/fuse/fuse-tegra.c
> +++ b/drivers/soc/tegra/fuse/fuse-tegra.c
> @@ -259,6 +259,7 @@ static int tegra_fuse_probe(struct platform_device *pdev)
>   
>   static int __maybe_unused tegra_fuse_runtime_resume(struct device *dev)
>   {
> +	struct tegra_fuse *fuse = dev_get_drvdata(dev);
>   	int err;
>   
>   	err = clk_prepare_enable(fuse->clk);
> @@ -272,6 +273,8 @@ static int __maybe_unused tegra_fuse_runtime_resume(struct device *dev)
>   
>   static int __maybe_unused tegra_fuse_runtime_suspend(struct device *dev)
>   {
> +	struct tegra_fuse *fuse = dev_get_drvdata(dev);
> +
>   	clk_disable_unprepare(fuse->clk);
>   
>   	return 0;
> @@ -279,6 +282,7 @@ static int __maybe_unused tegra_fuse_runtime_suspend(struct device *dev)
>   
>   static int __maybe_unused tegra_fuse_suspend(struct device *dev)
>   {
> +	struct tegra_fuse *fuse = dev_get_drvdata(dev);
>   	int ret;
>   
>   	/*
> @@ -295,6 +299,7 @@ static int __maybe_unused tegra_fuse_suspend(struct device *dev)
>   
>   static int __maybe_unused tegra_fuse_resume(struct device *dev)
>   {
> +	struct tegra_fuse *fuse = dev_get_drvdata(dev);
>   	int ret = 0;
>   
>   	if (fuse->soc->clk_suspend_on)

So now we have both local and global variables called 'fuse'. It would 
be better to have a different name to distinguish between these.

Jon

-- 
nvpublic


      reply	other threads:[~2026-05-14  8:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14  5:35 [PATCH RESEND] soc/tegra: fuse: Use device-specific instance in suspend/resume Kartik Rajput
2026-05-14  8:03 ` Jon Hunter [this message]

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=2a75a688-2bd8-4f74-83cd-7da80538795e@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=kees@kernel.org \
    --cc=kkartik@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@kernel.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