Skip to content

Commit 0d04d0c

Browse files
lokeshvutlaMarc Zyngier
authored andcommitted
gpio: thunderx: Use the default parent apis for {request,release}_resources
thunderx_gpio_irq_{request,release}_resources apis are trying to {request,release} resources on parent interrupt. There are default apis doing the same. Use the default parent apis instead of writing the same code snippet. Cc: linux-gpio@vger.kernel.org Cc: Linus Walleij <linus.walleij@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 2bd1298 commit 0d04d0c

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/gpio/gpio-thunderx.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,33 +363,25 @@ static int thunderx_gpio_irq_request_resources(struct irq_data *data)
363363
{
364364
struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
365365
struct thunderx_gpio *txgpio = txline->txgpio;
366-
struct irq_data *parent_data = data->parent_data;
367366
int r;
368367

369368
r = gpiochip_lock_as_irq(&txgpio->chip, txline->line);
370369
if (r)
371370
return r;
372371

373-
if (parent_data && parent_data->chip->irq_request_resources) {
374-
r = parent_data->chip->irq_request_resources(parent_data);
375-
if (r)
376-
goto error;
377-
}
372+
r = irq_chip_request_resources_parent(data);
373+
if (r)
374+
gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
378375

379-
return 0;
380-
error:
381-
gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
382376
return r;
383377
}
384378

385379
static void thunderx_gpio_irq_release_resources(struct irq_data *data)
386380
{
387381
struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
388382
struct thunderx_gpio *txgpio = txline->txgpio;
389-
struct irq_data *parent_data = data->parent_data;
390383

391-
if (parent_data && parent_data->chip->irq_release_resources)
392-
parent_data->chip->irq_release_resources(parent_data);
384+
irq_chip_release_resources_parent(data);
393385

394386
gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
395387
}

0 commit comments

Comments
 (0)