History

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.

Thierry Reding committed 7 years ago

Commit 7f0e60c1 parent f5b4c8b2 files · +2 −4Browse files

Unified · Split

2 files
  1. drivers/mfd/max77620.c +2 −3
  2. include/linux/mfd/max77620.h +0 −1
drivers/mfd/max77620.c+2−3
@@ -507,7 +507,6 @@ static int max77620_probe(struct i2c_client *client, · 506 unmodified lines
507 507
508 i2c_set_clientdata(client, chip);508 i2c_set_clientdata(client, chip);
509 chip->dev = &client->dev;509 chip->dev = &client->dev;
510 chip->irq_base = -1;
511 chip->chip_irq = client->irq;510 chip->chip_irq = client->irq;
512 chip->chip_id = (enum max77620_chip_id)id->driver_data;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 max77620_top_irq_chip.irq_drv_data = chip;545 max77620_top_irq_chip.irq_drv_data = chip;
547 ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq,546 ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq,
548 IRQF_ONESHOT | IRQF_SHARED,547 IRQF_ONESHOT | IRQF_SHARED, 0,
549 chip->irq_base, &max77620_top_irq_chip,548 &max77620_top_irq_chip,
550 &chip->top_irq_data);549 &chip->top_irq_data);
551 if (ret < 0) {550 if (ret < 0) {
552 dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret);551 dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret);
include/linux/mfd/max77620.h+0−1
@@ -329,7 +329,6 @@ struct max77620_chip { · 328 unmodified lines
329 struct regmap *rmap;329 struct regmap *rmap;
330 330
331 int chip_irq;331 int chip_irq;
332 int irq_base;
333 332
334 /* chip id */333 /* chip id */
335 enum max77620_chip_id chip_id;334 enum max77620_chip_id chip_id;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t