regmap_add_irq_chip() will try to allocate all of the IRQ descriptors upfront if passed a non-zero irq_base parameter. However, the intention is to allocate IRQ descriptors on an as-needed basis if possible. Pass 0 instead of -1 to fix that use-case.
Unified · Split
| @@ -507,7 +507,6 @@ static int max77620_probe(struct i2c_client *client, · 506 unmodified lines | ||
| 507 | 507 | |
| 508 | 508 | i2c_set_clientdata(client, chip); |
| 509 | 509 | chip->dev = &client->dev; |
| 510 | − chip->irq_base = -1; | |
| 511 | 510 | chip->chip_irq = client->irq; |
| 512 | 511 | chip->chip_id = (enum max77620_chip_id)id->driver_data; |
| 513 | 512 | |
| @@ -545,8 +544,8 @@ static int max77620_probe(struct i2c_client *client, · 31 unmodified lines | ||
| 545 | 544 | |
| 546 | 545 | max77620_top_irq_chip.irq_drv_data = chip; |
| 547 | 546 | ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq, |
| 548 | − IRQF_ONESHOT | IRQF_SHARED, | |
| 549 | − chip->irq_base, &max77620_top_irq_chip, | |
| 547 | + IRQF_ONESHOT | IRQF_SHARED, 0, | |
| 548 | + &max77620_top_irq_chip, | |
| 550 | 549 | &chip->top_irq_data); |
| 551 | 550 | if (ret < 0) { |
| 552 | 551 | dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret); |
| @@ -329,7 +329,6 @@ struct max77620_chip { · 328 unmodified lines | ||
| 329 | 329 | struct regmap *rmap; |
| 330 | 330 | |
| 331 | 331 | int chip_irq; |
| 332 | − int irq_base; | |
| 333 | 332 | |
| 334 | 333 | /* chip id */ |
| 335 | 334 | enum max77620_chip_id chip_id; |