lkml.org 
[lkml]   [2021]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2021-12-16 16:01    [W:0.138 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site