diff options
| author | Lokesh Vutla <[email protected]> | 2019-04-30 10:12:23 +0000 |
|---|---|---|
| committer | Marc Zyngier <[email protected]> | 2019-05-01 09:41:38 +0000 |
| commit | 0d04d0c146786da42c6e68c7d2f09c956c5b5bd3 (patch) | |
| tree | 036003bab5e527ad45dcfbbd5c1a8f4e55dde9a0 /drivers/gpio/gpio-thunderx.c | |
| parent | genirq: Introduce irq_chip_{request,release}_resource_parent() apis (diff) | |
| download | kernel-0d04d0c146786da42c6e68c7d2f09c956c5b5bd3.tar.gz kernel-0d04d0c146786da42c6e68c7d2f09c956c5b5bd3.zip | |
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: [email protected]
Cc: Linus Walleij <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Lokesh Vutla <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-thunderx.c')
| -rw-r--r-- | drivers/gpio/gpio-thunderx.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c index 1306722faa5a..715371b5102a 100644 --- a/drivers/gpio/gpio-thunderx.c +++ b/drivers/gpio/gpio-thunderx.c @@ -363,22 +363,16 @@ static int thunderx_gpio_irq_request_resources(struct irq_data *data) { struct thunderx_line *txline = irq_data_get_irq_chip_data(data); struct thunderx_gpio *txgpio = txline->txgpio; - struct irq_data *parent_data = data->parent_data; int r; r = gpiochip_lock_as_irq(&txgpio->chip, txline->line); if (r) return r; - if (parent_data && parent_data->chip->irq_request_resources) { - r = parent_data->chip->irq_request_resources(parent_data); - if (r) - goto error; - } + r = irq_chip_request_resources_parent(data); + if (r) + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); - return 0; -error: - gpiochip_unlock_as_irq(&txgpio->chip, txline->line); return r; } @@ -386,10 +380,8 @@ static void thunderx_gpio_irq_release_resources(struct irq_data *data) { struct thunderx_line *txline = irq_data_get_irq_chip_data(data); struct thunderx_gpio *txgpio = txline->txgpio; - struct irq_data *parent_data = data->parent_data; - if (parent_data && parent_data->chip->irq_release_resources) - parent_data->chip->irq_release_resources(parent_data); + irq_chip_release_resources_parent(data); gpiochip_unlock_as_irq(&txgpio->chip, txline->line); } |
