Skip to content

Commit 3c83818

Browse files
ukleinekBartosz Golaszewski
authored andcommitted
gpio: altera: Drop .mapped_irq from driver data
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> Link: https://lore.kernel.org/r/20250109090802.3763275-2-u.kleine-koenig@baylibre.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 65b3aac commit 3c83818

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/gpio/gpio-altera.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@
3232
* will be blocked until the current one completes.
3333
* @interrupt_trigger : specifies the hardware configured IRQ trigger type
3434
* (rising, falling, both, high)
35-
* @mapped_irq : kernel mapped irq number.
3635
*/
3736
struct altera_gpio_chip {
3837
struct gpio_chip gc;
3938
void __iomem *regs;
4039
raw_spinlock_t gpio_lock;
4140
int interrupt_trigger;
42-
int mapped_irq;
4341
};
4442

4543
static void altera_gpio_irq_unmask(struct irq_data *d)
@@ -235,6 +233,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
235233
int reg, ret;
236234
struct altera_gpio_chip *altera_gc;
237235
struct gpio_irq_chip *girq;
236+
int mapped_irq;
238237

239238
altera_gc = devm_kzalloc(&pdev->dev, sizeof(*altera_gc), GFP_KERNEL);
240239
if (!altera_gc)
@@ -271,8 +270,8 @@ static int altera_gpio_probe(struct platform_device *pdev)
271270
if (IS_ERR(altera_gc->regs))
272271
return dev_err_probe(dev, PTR_ERR(altera_gc->regs), "failed to ioremap memory resource\n");
273272

274-
altera_gc->mapped_irq = platform_get_irq_optional(pdev, 0);
275-
if (altera_gc->mapped_irq < 0)
273+
mapped_irq = platform_get_irq_optional(pdev, 0);
274+
if (mapped_irq < 0)
276275
goto skip_irq;
277276

278277
if (device_property_read_u32(dev, "altr,interrupt-type", &reg)) {
@@ -296,7 +295,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
296295
return -ENOMEM;
297296
girq->default_type = IRQ_TYPE_NONE;
298297
girq->handler = handle_bad_irq;
299-
girq->parents[0] = altera_gc->mapped_irq;
298+
girq->parents[0] = mapped_irq;
300299

301300
skip_irq:
302301
ret = devm_gpiochip_add_data(dev, &altera_gc->gc, altera_gc);

0 commit comments

Comments
 (0)