Re: [PATCH V5 8/8] cpufreq: Add Rust based cpufreq-dt driver
From: Rob Herring
Date: Thu Aug 01 2024 - 12:07:48 EST
On Thu, Aug 1, 2024 at 2:31 AM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> On 31-07-24, 15:14, Rob Herring wrote:
> > We don't want anything in Rust based on of_find_property() which this
> > is. That function assumes a device node and its properties are never
> > freed which is no longer a valid assumption (since OF_DYNAMIC and then
> > overlays). There's some work starting to address that, and my plan is
> > using of_find_property() on dynamic nodes will start warning. The
> > of_property_* API mostly avoids that issue (string types are an issue)
>
> Okay. Migrated to of_property_present() now. Thanks.
>
> > Also, it's probably the device property API we want to build Rust
> > bindings on top of rather than DT and ACPI. OTOH, the device property
> > API may be missing some features needed with OPP bindings.
>
> I am not sure which device properties are you talking about. Are there
> any OF related examples available there ?
device_property_*()
Basically a wrapper around fwnode APIs taking struct device rather
than fwnode. While I think the sharing of properties between DT and
ACPI is flawed and converting C drivers from of_property_ to
device_property_ calls is pointless, I think since rust bindings are a
blank page, using the device_property_ API makes sense.
Rob