[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c4dc20c6-d0cd-4a2f-81be-e672ace75e67@nvidia.com>
Date: Tue, 20 May 2025 12:46:45 +0100
From: Jon Hunter <jonathanh@...dia.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: webgeek1234@...il.com, "Rafael J. Wysocki" <rafael@...nel.org>,
Thierry Reding <thierry.reding@...il.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH v4 2/2] cpufreq: tegra124: Allow building as a module
On 20/05/2025 11:30, Viresh Kumar wrote:
> On 20-05-25, 11:03, Jon Hunter wrote:
>> On 19/05/2025 11:26, Viresh Kumar wrote:
>>> Not sure if we can do that. The clks belong to the CPU device, while
>>> the devm_* functions are using &pdev->dev. The CPU device never goes
>>> away and so the resources won't get freed if we use devm for the CPU
>>> device.
>
> That would have been the case, if we can actually do a devm_clk_get()
> in the first place, but...
>
>> I don't follow. If they are allocated in the probe using the pdev->dev
>> device by using devm_clk_get() they should get freed when the platform
>> device is removed.
>
> ... devm_clk_get(&pdev->dev, ...) won't work here IIUC. The clks
> belong to the CPU device and not pdev->dev. That's why we are doing
> of_clk_get_by_name() over the CPU device's OF node here.
>
> Maybe I am wrong, but I don't see how devm_* can be used here for
> clks.
Ah yes, we are using the 'np' pointer for the CPU node and not the
platform device node. OK scratch that.
Jon
--
nvpublic
Powered by blists - more mailing lists