Skip to content

Commit 7f0e60c

Browse files
thierryredingLee Jones
authored andcommitted
mfd: max77620: Do not allocate IRQs upfront
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. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent f5b4c8b commit 7f0e60c

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/mfd/max77620.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ static int max77620_probe(struct i2c_client *client,
507507

508508
i2c_set_clientdata(client, chip);
509509
chip->dev = &client->dev;
510-
chip->irq_base = -1;
511510
chip->chip_irq = client->irq;
512511
chip->chip_id = (enum max77620_chip_id)id->driver_data;
513512

@@ -545,8 +544,8 @@ static int max77620_probe(struct i2c_client *client,
545544

546545
max77620_top_irq_chip.irq_drv_data = chip;
547546
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,
550549
&chip->top_irq_data);
551550
if (ret < 0) {
552551
dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret);

‎include/linux/mfd/max77620.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ struct max77620_chip {
329329
struct regmap *rmap;
330330

331331
int chip_irq;
332-
int irq_base;
333332

334333
/* chip id */
335334
enum max77620_chip_id chip_id;

0 commit comments

Comments
 (0)