Message ID | 20250414100409.3910312-4-andriy.shevchenko@linux.intel.com |
---|---|
State | Superseded |
Headers | show |
Series | [v4,1/7] i2c: core: Drop duplicate check before calling OF APIs | expand |
On Mon, Apr 14, 2025 at 01:01:53PM +0300, Andy Shevchenko wrote: > Switch to fwnode APIs to get IRQ. In particular this enables > a support of the separate wakeup IRQ. The rest is converted You mean it enables the support of wakeup irqs for ACPI? Otherwise I wouldn't know what you mean here... > just for the sake of consistency and fwnode reuse.
On Tue, Apr 15, 2025 at 10:06:06PM +0200, Wolfram Sang wrote: > On Mon, Apr 14, 2025 at 01:01:53PM +0300, Andy Shevchenko wrote: > > Switch to fwnode APIs to get IRQ. In particular this enables > > a support of the separate wakeup IRQ. The rest is converted > > You mean it enables the support of wakeup irqs for ACPI? Otherwise I > wouldn't know what you mean here... Re-reading this I'm also puzzled if I was interrupted in the middle of writing it :-) From the code perspective, yes, I meant something like that (rather "in non-OF cases"). > > just for the sake of consistency and fwnode reuse.
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index edab56e5d5e5..04985abe0e5d 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -26,14 +26,13 @@ #include <linux/idr.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <linux/irqflags.h> +#include <linux/irq.h> #include <linux/jump_label.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/of_device.h> #include <linux/of.h> -#include <linux/of_irq.h> #include <linux/pinctrl/consumer.h> #include <linux/pinctrl/devinfo.h> #include <linux/pm_domain.h> @@ -510,9 +509,9 @@ static int i2c_device_probe(struct device *dev) pm_runtime_get_sync(&client->adapter->dev); irq = i2c_smbus_host_notify_to_irq(client); } else if (is_of_node(fwnode)) { - irq = of_irq_get_byname(dev->of_node, "irq"); + irq = fwnode_irq_get_byname(fwnode, "irq"); if (irq == -EINVAL || irq == -ENODATA) - irq = of_irq_get(dev->of_node, 0); + irq = fwnode_irq_get(fwnode, 0); } else if (is_acpi_device_node(fwnode)) { bool wake_capable; @@ -547,7 +546,7 @@ static int i2c_device_probe(struct device *dev) if (client->flags & I2C_CLIENT_WAKE) { int wakeirq; - wakeirq = of_irq_get_byname(dev->of_node, "wakeup"); + wakeirq = fwnode_irq_get_byname(fwnode, "wakeup"); if (wakeirq == -EPROBE_DEFER) { status = wakeirq; goto put_sync_adapter;