diff options
author | Maxime Ripard <maxime@cerno.tech> | 2023-01-03 08:32:12 +0100 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2023-01-03 08:32:12 +0100 |
commit | 2c55d703391acf7e9101da596d0c15ee03b318a3 (patch) | |
tree | 422ef671343624b56d333b47d20a538eeedbfe10 /drivers/bcma | |
parent | 92d43bd3bc9728c1fb114d7011d46f5ea9489e28 (diff) | |
parent | 88603b6dc419445847923fcb7fe5080067a30f98 (diff) |
Merge drm/drm-fixes into drm-misc-fixes
Let's start the fixes cycle.
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/bcma')
-rw-r--r-- | drivers/bcma/driver_gpio.c | 8 | ||||
-rw-r--r-- | drivers/bcma/main.c | 4 | ||||
-rw-r--r-- | drivers/bcma/sprom.c | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c index 65fb9bad1577..5f90bac6bb09 100644 --- a/drivers/bcma/driver_gpio.c +++ b/drivers/bcma/driver_gpio.c @@ -82,6 +82,7 @@ static void bcma_gpio_irq_unmask(struct irq_data *d) int gpio = irqd_to_hwirq(d); u32 val = bcma_chipco_gpio_in(cc, BIT(gpio)); + gpiochip_enable_irq(gc, gpio); bcma_chipco_gpio_polarity(cc, BIT(gpio), val); bcma_chipco_gpio_intmask(cc, BIT(gpio), BIT(gpio)); } @@ -93,12 +94,15 @@ static void bcma_gpio_irq_mask(struct irq_data *d) int gpio = irqd_to_hwirq(d); bcma_chipco_gpio_intmask(cc, BIT(gpio), 0); + gpiochip_disable_irq(gc, gpio); } -static struct irq_chip bcma_gpio_irq_chip = { +static const struct irq_chip bcma_gpio_irq_chip = { .name = "BCMA-GPIO", .irq_mask = bcma_gpio_irq_mask, .irq_unmask = bcma_gpio_irq_unmask, + .flags = IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id) @@ -139,7 +143,7 @@ static int bcma_gpio_irq_init(struct bcma_drv_cc *cc) bcma_chipco_gpio_intmask(cc, ~0, 0); bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO); - girq->chip = &bcma_gpio_irq_chip; + gpio_irq_chip_set_chip(girq, &bcma_gpio_irq_chip); /* This will let us handle the parent IRQ in the driver */ girq->parent_handler = NULL; girq->num_parents = 0; diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 44392b624b20..0a8469e0b13a 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -344,8 +344,10 @@ static int bcma_register_devices(struct bcma_bus *bus) err = bcma_gpio_init(&bus->drv_cc); if (err == -ENOTSUPP) bcma_debug(bus, "GPIO driver not activated\n"); - else if (err) + else if (err) { bcma_err(bus, "Error registering GPIO driver: %i\n", err); + return err; + } if (bus->hosttype == BCMA_HOSTTYPE_SOC) { err = bcma_chipco_watchdog_register(&bus->drv_cc); diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c index 3da01f173c63..e668ad7963fc 100644 --- a/drivers/bcma/sprom.c +++ b/drivers/bcma/sprom.c @@ -165,7 +165,7 @@ static int bcma_sprom_valid(struct bcma_bus *bus, const u16 *sprom, return err; revision = sprom[words - 1] & SSB_SPROM_REVISION_REV; - if (revision != 8 && revision != 9 && revision != 10) { + if (revision < 8 || revision > 11) { pr_err("Unsupported SPROM revision: %d\n", revision); return -ENOENT; } |