[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cdbc7ecc-6676-4702-bbe3-6d275d561185@nvidia.com>
Date: Thu, 23 Oct 2025 15:02:12 +0530
From: Kartik Rajput <kkartik@...dia.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: alexandre.belloni@...tlin.com, thierry.reding@...il.com,
jonathanh@...dia.com, linux-rtc@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] rtc: tegra: Add ACPI support
On 23/10/25 13:05, Andy Shevchenko wrote:
> External email: Use caution opening links or attachments
>
>
> 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
>
>
Thanks for the suggestions, Andy! I have posted v3 with all these changes here:
https://lore.kernel.org/linux-tegra/20251023093042.770798-1-kkartik@nvidia.com/T/#t
Regards,
Kartik
Powered by blists - more mailing lists