Commit 0d04d0c1 authored by Lokesh Vutla's avatar Lokesh Vutla Committed by Marc Zyngier

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: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarLokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 2bd1298a
...@@ -363,22 +363,16 @@ static int thunderx_gpio_irq_request_resources(struct irq_data *data) ...@@ -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_line *txline = irq_data_get_irq_chip_data(data);
struct thunderx_gpio *txgpio = txline->txgpio; struct thunderx_gpio *txgpio = txline->txgpio;
struct irq_data *parent_data = data->parent_data;
int r; int r;
r = gpiochip_lock_as_irq(&txgpio->chip, txline->line); r = gpiochip_lock_as_irq(&txgpio->chip, txline->line);
if (r) if (r)
return r; return r;
if (parent_data && parent_data->chip->irq_request_resources) { r = irq_chip_request_resources_parent(data);
r = parent_data->chip->irq_request_resources(parent_data); if (r)
if (r) gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
goto error;
}
return 0;
error:
gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
return r; return r;
} }
...@@ -386,10 +380,8 @@ static void thunderx_gpio_irq_release_resources(struct irq_data *data) ...@@ -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_line *txline = irq_data_get_irq_chip_data(data);
struct thunderx_gpio *txgpio = txline->txgpio; struct thunderx_gpio *txgpio = txline->txgpio;
struct irq_data *parent_data = data->parent_data;
if (parent_data && parent_data->chip->irq_release_resources) irq_chip_release_resources_parent(data);
parent_data->chip->irq_release_resources(parent_data);
gpiochip_unlock_as_irq(&txgpio->chip, txline->line); gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment