From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Kartik Rajput <kkartik@nvidia.com>
Cc: alexandre.belloni@bootlin.com, thierry.reding@gmail.com,
jonathanh@nvidia.com, linux-rtc@vger.kernel.org,
linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rtc: tegra: Add ACPI support
Date: Thu, 23 Oct 2025 10:35:57 +0300 [thread overview]
Message-ID: <aPna3Q9L4Rc9Ufxt@smile.fi.intel.com> (raw)
In-Reply-To: <f4defdc9-2cc0-45a0-a391-cb8678eb1b23@nvidia.com>
On Thu, Oct 23, 2025 at 12:14:13PM +0530, Kartik Rajput wrote:
> On 22/10/25 22:38, Andy Shevchenko wrote:
> > On Wed, Oct 22, 2025 at 12:06:45PM +0530, Kartik Rajput wrote:
...
> > > - info->clk = devm_clk_get(&pdev->dev, NULL);
> > > - if (IS_ERR(info->clk))
> > > - return PTR_ERR(info->clk);
> > > + if (dev_of_node(&pdev->dev)) {
> > > + info->clk = devm_clk_get(&pdev->dev, NULL);
> > > + if (IS_ERR(info->clk))
> > > + return PTR_ERR(info->clk);
> > > + }
> > >
> > > ret = clk_prepare_enable(info->clk);
> >
> > Since we still call CLK APIs unconditionally here, shouldn't be the whole
> > approach just to move to _optional() CLK API?
> >
> > info->clk = devm_clk_get_optional(&pdev->dev, NULL);
> >
> > I haven't checked the code below, but maybe even one can incorporate _enabled
> > to this as well (in a separate change as it's not related to this patch
> > directly).
>
> The reason I did not use the _optional API is because the clocks are required
> for the device-tree. Therefore, it must fail if clocks are not provided on
> device-tree boot.
I see, please mention this in the commit message. And perhaps add a patch to
convert to devm_clk_get_enabled().
On top of that you also can convert driver to use pm_sleep_ptr() and drop ugly
ifdeffery. But this is really out of scope, and up to you to decide.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-10-23 7:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 6:36 [PATCH v2] rtc: tegra: Add ACPI support Kartik Rajput
2025-10-22 17:08 ` Andy Shevchenko
2025-10-23 6:44 ` Kartik Rajput
2025-10-23 7:35 ` Andy Shevchenko [this message]
2025-10-23 9:32 ` Kartik Rajput
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=aPna3Q9L4Rc9Ufxt@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=jonathanh@nvidia.com \
--cc=kkartik@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.