[PATCH v1 1/6] gpio: dwapb: Replace irq_shared flag with fwnode type check

From: Andy Shevchenko
Date: Mon Jun 08 2020 - 09:43:24 EST


Shared IRQ is only enabled for ACPI platforms or pure platform drivers,
there is no need to have a special flag for that, since we simple can test
port fwnode to be type of OF.

While at it, drop duplicate declaration of loop variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Cc: Lee Jones <lee.jones@xxxxxxxxxx>
---
drivers/gpio/gpio-dwapb.c | 5 +----
drivers/mfd/intel_quark_i2c_gpio.c | 1 -
include/linux/platform_data/gpio-dwapb.h | 1 -
3 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index 1d8d55bd63aa..a7ca72086511 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -418,9 +418,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
irq_gc->chip_types[1].type = IRQ_TYPE_EDGE_BOTH;
irq_gc->chip_types[1].handler = handle_edge_irq;

- if (!pp->irq_shared) {
- int i;
-
+ if (to_of_node(pp->fwnode)) {
for (i = 0; i < pp->ngpio; i++) {
if (pp->irq[i])
irq_set_chained_handler_and_data(pp->irq[i],
@@ -601,7 +599,6 @@ static struct dwapb_platform_data *dwapb_gpio_get_pdata(struct device *dev)
pp->ngpio = 32;
}

- pp->irq_shared = false;
pp->gpio_base = -1;

/*
diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
index 84ca7902e1df..06b538dd124c 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -216,7 +216,6 @@ static int intel_quark_gpio_setup(struct pci_dev *pdev, struct mfd_cell *cell)
pdata->properties->ngpio = INTEL_QUARK_MFD_NGPIO;
pdata->properties->gpio_base = INTEL_QUARK_MFD_GPIO_BASE;
pdata->properties->irq[0] = pdev->irq;
- pdata->properties->irq_shared = true;

cell->platform_data = pdata;
cell->pdata_size = sizeof(*pdata);
diff --git a/include/linux/platform_data/gpio-dwapb.h b/include/linux/platform_data/gpio-dwapb.h
index ff1be737bad6..a63010b6e898 100644
--- a/include/linux/platform_data/gpio-dwapb.h
+++ b/include/linux/platform_data/gpio-dwapb.h
@@ -12,7 +12,6 @@ struct dwapb_port_property {
unsigned int ngpio;
unsigned int gpio_base;
int irq[32];
- bool irq_shared;
};

struct dwapb_platform_data {
--
2.27.0.rc2