Skip to content

Commit fe92a23

Browse files
larsclausenralfbaechle
authored andcommitted
MIPS: JZ4740: Cleanup the mechanical irq_chip conversion
The conversion did not make use of the new chip flag which signals the core code to mask the chip before calling the set_type callback. Sigh. Use the new lockdep helper as well. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> To: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/2183/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent cd11d14 commit fe92a23

1 file changed

Lines changed: 2 additions & 15 deletions

File tree

‎arch/mips/jz4740/gpio.c‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -347,22 +347,14 @@ static void jz_gpio_irq_unmask(struct irq_data *data)
347347
/* TODO: Check if function is gpio */
348348
static unsigned int jz_gpio_irq_startup(struct irq_data *data)
349349
{
350-
struct irq_desc *desc = irq_to_desc(data->irq);
351-
352350
jz_gpio_set_irq_bit(data, JZ_REG_GPIO_SELECT_SET);
353-
354-
desc->status &= ~IRQ_MASKED;
355351
jz_gpio_irq_unmask(data);
356-
357352
return 0;
358353
}
359354

360355
static void jz_gpio_irq_shutdown(struct irq_data *data)
361356
{
362-
struct irq_desc *desc = irq_to_desc(data->irq);
363-
364357
jz_gpio_irq_mask(data);
365-
desc->status |= IRQ_MASKED;
366358

367359
/* Set direction to input */
368360
jz_gpio_set_irq_bit(data, JZ_REG_GPIO_DIRECTION_CLEAR);
@@ -377,11 +369,8 @@ static void jz_gpio_irq_ack(struct irq_data *data)
377369
static int jz_gpio_irq_set_type(struct irq_data *data, unsigned int flow_type)
378370
{
379371
struct jz_gpio_chip *chip = irq_to_jz_gpio_chip(data);
380-
struct irq_desc *desc = irq_to_desc(data->irq);
381372
unsigned int irq = data->irq;
382373

383-
jz_gpio_irq_mask(data);
384-
385374
if (flow_type == IRQ_TYPE_EDGE_BOTH) {
386375
uint32_t value = readl(chip->base + JZ_REG_GPIO_PIN);
387376
if (value & IRQ_TO_BIT(irq))
@@ -414,9 +403,6 @@ static int jz_gpio_irq_set_type(struct irq_data *data, unsigned int flow_type)
414403
return -EINVAL;
415404
}
416405

417-
if (!(desc->status & IRQ_MASKED))
418-
jz_gpio_irq_unmask(data);
419-
420406
return 0;
421407
}
422408

@@ -443,6 +429,7 @@ static struct irq_chip jz_gpio_irq_chip = {
443429
.irq_shutdown = jz_gpio_irq_shutdown,
444430
.irq_set_type = jz_gpio_irq_set_type,
445431
.irq_set_wake = jz_gpio_irq_set_wake,
432+
.flags = IRQCHIP_SET_TYPE_MASKED,
446433
};
447434

448435
/*
@@ -527,7 +514,7 @@ static int jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id)
527514
set_irq_chained_handler(chip->irq, jz_gpio_irq_demux_handler);
528515

529516
for (irq = chip->irq_base; irq < chip->irq_base + chip->gpio_chip.ngpio; ++irq) {
530-
lockdep_set_class(&irq_desc[irq].lock, &gpio_lock_class);
517+
irq_set_lockdep_class(irq, &gpio_lock_class);
531518
set_irq_chip_data(irq, chip);
532519
set_irq_chip_and_handler(irq, &jz_gpio_irq_chip,
533520
handle_level_irq);

0 commit comments

Comments
 (0)