Messages in this thread | | | From | Andy Shevchenko <> | Date | Thu, 16 Dec 2021 16:59:44 +0200 | Subject | Re: [PATCH 2/2] i2c: smbus: Use device_ functions instead of of_ |
| |
On Thu, Dec 16, 2021 at 3:14 PM Akhil R <akhilrajeev@nvidia.com> wrote: > > Change of_ functions to device_ for firmware agnostic usage.
of_*() device_*()
> This allows to have smbus_alert interrupt without any changes > in the controller drivers using ACPI table.
...
> - irq = of_property_match_string(adapter->dev.of_node, "interrupt-names", > - "smbus_alert"); > + irq = device_property_match_string(adapter->dev.parent, "interrupt-names", > + "smbus_alert");
Hmm... Adapter device node is not the same as the node for its parent. Do you have some code that propagates of_node from parent to child?
I.o.w. I would expect to see
irq = device_property_match_string(&adapter->dev, "interrupt-names",
here.
> if (irq == -EINVAL || irq == -ENODATA) > return 0; > else if (irq < 0)
TBH the entire code smells. "Interesting" way of getting an optional named interrupt.
-- With Best Regards, Andy Shevchenko
| |