[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250509-gpio-v1-9-639377c98288@nxp.com>
Date: Fri, 09 May 2025 12:45:40 +0800
From: "Peng Fan (OSS)" <peng.fan@....nxp.com>
To: Ray Jui <rjui@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Scott Branden <sbranden@...adcom.com>, Vladimir Zapolskiy <vz@...ia.com>,
Keerthy <j-keerthy@...com>, Robert Jarzmik <robert.jarzmik@...e.fr>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, Peng Fan <peng.fan@....com>
Subject: [PATCH RFC 9/9] gpio: pxa: Make irq_chip immutable
From: Peng Fan <peng.fan@....com>
Kernel warns about mutable irq_chips:
"not an immutable chip, please consider fixing!"
Constify pxa_muxed_gpio_chip, flag the irq_chip as IRQCHIP_IMMUTABLE,
add the new helper functions, and call the appropriate gpiolib functions.
Signed-off-by: Peng Fan <peng.fan@....com>
---
drivers/gpio/gpio-pxa.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index c3dfaed45c4319a54b545bd89b834253b77d369d..aead35ea090e6c37e80ae3c29e12c44cc8e930c7 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -497,6 +497,8 @@ static void pxa_mask_muxed_gpio(struct irq_data *d)
gfer = readl_relaxed(base + GFER_OFFSET) & ~GPIO_bit(gpio);
writel_relaxed(grer, base + GRER_OFFSET);
writel_relaxed(gfer, base + GFER_OFFSET);
+
+ gpiochip_disable_irq(&pchip->chip, gpio);
}
static int pxa_gpio_set_wake(struct irq_data *d, unsigned int on)
@@ -516,17 +518,21 @@ static void pxa_unmask_muxed_gpio(struct irq_data *d)
unsigned int gpio = irqd_to_hwirq(d);
struct pxa_gpio_bank *c = gpio_to_pxabank(&pchip->chip, gpio);
+ gpiochip_enable_irq(&pchip->chip, gpio);
+
c->irq_mask |= GPIO_bit(gpio);
update_edge_detect(c);
}
-static struct irq_chip pxa_muxed_gpio_chip = {
+static const struct irq_chip pxa_muxed_gpio_chip = {
.name = "GPIO",
.irq_ack = pxa_ack_muxed_gpio,
.irq_mask = pxa_mask_muxed_gpio,
.irq_unmask = pxa_unmask_muxed_gpio,
.irq_set_type = pxa_gpio_irq_type,
.irq_set_wake = pxa_gpio_set_wake,
+ .flags = IRQCHIP_IMMUTABLE,
+ GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static int pxa_gpio_nums(struct platform_device *pdev)
--
2.37.1
Powered by blists - more mailing lists