diff mbox series

[v2] gpio: altera: Drop .mapped_irq from driver data

Message ID 20250109090802.3763275-2-u.kleine-koenig@baylibre.com
State New
Headers show
Series [v2] gpio: altera: Drop .mapped_irq from driver data | expand

Commit Message

Uwe Kleine-König Jan. 9, 2025, 9:08 a.m. UTC
struct altera_gpio_chip::mapped_irq is only used in the driver's probe
function. So it's enough if mapped_irq is a local variable, and can be
dropped from driver data.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,

changes since (implicit) v1, available at
https://lore.kernel.org/linux-gpio/20250108094851.3683769-2-u.kleine-koenig@baylibre.com:

 - Drop the kdoc entry for mapped_irq to please the kernel test robot

Best regards
Uwe

 drivers/gpio/gpio-altera.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)


base-commit: 7b4b9bf203da94fbeac75ed3116c84aa03e74578

Comments

Bartosz Golaszewski Jan. 10, 2025, 1:19 p.m. UTC | #1
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Thu, 09 Jan 2025 10:08:03 +0100, Uwe Kleine-König wrote:
> struct altera_gpio_chip::mapped_irq is only used in the driver's probe
> function. So it's enough if mapped_irq is a local variable, and can be
> dropped from driver data.
> 
> 

Applied, thanks!

[1/1] gpio: altera: Drop .mapped_irq from driver data
      commit: 03b5e4901d063dfcb26bbeabb40154a275bd8bb8

Best regards,
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index 73e660c5e38a..17ab039c7413 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -32,14 +32,12 @@ 
 *			  will be blocked until the current one completes.
 * @interrupt_trigger	: specifies the hardware configured IRQ trigger type
 *			  (rising, falling, both, high)
-* @mapped_irq		: kernel mapped irq number.
 */
 struct altera_gpio_chip {
 	struct gpio_chip gc;
 	void __iomem *regs;
 	raw_spinlock_t gpio_lock;
 	int interrupt_trigger;
-	int mapped_irq;
 };
 
 static void altera_gpio_irq_unmask(struct irq_data *d)
@@ -235,6 +233,7 @@  static int altera_gpio_probe(struct platform_device *pdev)
 	int reg, ret;
 	struct altera_gpio_chip *altera_gc;
 	struct gpio_irq_chip *girq;
+	int mapped_irq;
 
 	altera_gc = devm_kzalloc(&pdev->dev, sizeof(*altera_gc), GFP_KERNEL);
 	if (!altera_gc)
@@ -271,8 +270,8 @@  static int altera_gpio_probe(struct platform_device *pdev)
 	if (IS_ERR(altera_gc->regs))
 		return dev_err_probe(dev, PTR_ERR(altera_gc->regs), "failed to ioremap memory resource\n");
 
-	altera_gc->mapped_irq = platform_get_irq_optional(pdev, 0);
-	if (altera_gc->mapped_irq < 0)
+	mapped_irq = platform_get_irq_optional(pdev, 0);
+	if (mapped_irq < 0)
 		goto skip_irq;
 
 	if (device_property_read_u32(dev, "altr,interrupt-type", &reg)) {
@@ -296,7 +295,7 @@  static int altera_gpio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	girq->default_type = IRQ_TYPE_NONE;
 	girq->handler = handle_bad_irq;
-	girq->parents[0] = altera_gc->mapped_irq;
+	girq->parents[0] = mapped_irq;
 
 skip_irq:
 	ret = devm_gpiochip_add_data(dev, &altera_gc->gc, altera_gc);