Re: [PATCH v3 1/3] rtc: m41t80: probe: use IS_ENABLED for CONFIG_OF
From: Dennis Lambe
Date: Thu Jan 19 2023 - 18:20:13 EST
On Thu, Jan 19, 2023 at 5:21 PM Alexandre Belloni
<alexandre.belloni@xxxxxxxxxxx> wrote:
> > -#ifdef CONFIG_OF
> > - wakeup_source = of_property_read_bool(client->dev.of_node,
> > - "wakeup-source");
> > -#endif
> > + if (IS_ENABLED(CONFIG_OF)) {
> > + wakeup_source = of_property_read_bool(client->dev.of_node,
> > + "wakeup-source");
> > + }
> > +
>
> A way better patch would switch to fwnode_property_read_bool
If you like that better, I'll make sure that's how I do it in future
revs of the patchset. I didn't know if it was appropriate since I
don't know if it would ever make sense to call acpi_dev_prop_get on
"wakeup-source" or "quartz-load-femtofarads", or if that kind of
consideration should even matter when choosing to use fwnode_* instead
of of_*.
--
Dennis Lambe (He/Him)
Lead Firmware Engineer
sparkcharge.io