On Thu, Nov 5, 2020 at 10:00 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > > Most I2C-drivers treat IRQs as optional and in some cases ACPI > devices managed by i2c-multi-instantiate.c may have a GpioInt resource > specified on some systems, while it is not there on others. GpioInt() > Add a new IRQ_RESOURCE_GPIO_OPTIONAL IRQ type, which still tries to get > a GpioInt IRQ, but does not consider it a fatal error when this fails. GpioInt() ... > -#define IRQ_RESOURCE_TYPE GENMASK(1, 0) > -#define IRQ_RESOURCE_NONE 0 > -#define IRQ_RESOURCE_GPIO 1 > -#define IRQ_RESOURCE_APIC 2 > +#define IRQ_RESOURCE_TYPE GENMASK(1, 0) > +#define IRQ_RESOURCE_NONE 0 > +#define IRQ_RESOURCE_GPIO 1 > +#define IRQ_RESOURCE_GPIO_OPTIONAL 2 > +#define IRQ_RESOURCE_APIC 3 I think flag is cleaner: #define IRQ_RESOURCE_OPTIONAL BIT(2) ... > case IRQ_RESOURCE_GPIO: > ret = acpi_dev_gpio_irq_get(adev, inst_data[i].irq_idx); > - if (ret < 0) { > + if (ret < 0 && (!irq_optional || ret != -ENOENT)) { ret < 0 && !((inst_data[i].flags & IRQ_RESOURCE_OPTIONAL) && ret == -ENOENT) > dev_err(dev, "Error requesting irq at index %d: %d\n", > inst_data[i].irq_idx, ret); > goto error; -- With Best Regards, Andy Shevchenko