Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thierry Reding and committed by
Lee Jones
7f0e60c7 f5b4c8b4

+2 -4
+2 -3
drivers/mfd/max77620.c
··· 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 ··· 544 545 545 546 max77620_top_irq_chip.irq_drv_data = chip; 546 547 ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq, 547 - IRQF_ONESHOT | IRQF_SHARED, 548 - chip->irq_base, &max77620_top_irq_chip, 548 + IRQF_ONESHOT | IRQF_SHARED, 0, 549 + &max77620_top_irq_chip, 549 550 &chip->top_irq_data); 550 551 if (ret < 0) { 551 552 dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret);
-1
include/linux/mfd/max77620.h
··· 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;