summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-thunderx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-thunderx.c')
-rw-r--r--drivers/gpio/gpio-thunderx.c16
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)
363{ 363{
364 struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 364 struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
365 struct thunderx_gpio *txgpio = txline->txgpio; 365 struct thunderx_gpio *txgpio = txline->txgpio;
366 struct irq_data *parent_data = data->parent_data;
367 int r; 366 int r;
368 367
369 r = gpiochip_lock_as_irq(&txgpio->chip, txline->line); 368 r = gpiochip_lock_as_irq(&txgpio->chip, txline->line);
370 if (r) 369 if (r)
371 return r; 370 return r;
372 371
373 if (parent_data && parent_data->chip->irq_request_resources) { 372 r = irq_chip_request_resources_parent(data);
374 r = parent_data->chip->irq_request_resources(parent_data); 373 if (r)
375 if (r) 374 gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
376 goto error;
377 }
378 375
379 return 0;
380error:
381 gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
382 return r; 376 return r;
383} 377}
384 378
@@ -386,10 +380,8 @@ static void thunderx_gpio_irq_release_resources(struct irq_data *data)
386{ 380{
387 struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 381 struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
388 struct thunderx_gpio *txgpio = txline->txgpio; 382 struct thunderx_gpio *txgpio = txline->txgpio;
389 struct irq_data *parent_data = data->parent_data;
390 383
391 if (parent_data && parent_data->chip->irq_release_resources) 384 irq_chip_release_resources_parent(data);
392 parent_data->chip->irq_release_resources(parent_data);
393 385
394 gpiochip_unlock_as_irq(&txgpio->chip, txline->line); 386 gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
395} 387}