OSDN Git Service

mfd: max77620: Do not allocate IRQs upfront
authorThierry Reding <treding@nvidia.com>
Wed, 2 Oct 2019 14:43:18 +0000 (16:43 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 11 Nov 2019 08:45:02 +0000 (08:45 +0000)
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>
drivers/mfd/max77620.c
include/linux/mfd/max77620.h

index a851ff4..c7ed5c3 100644 (file)
@@ -507,7 +507,6 @@ static int max77620_probe(struct i2c_client *client,
 
        i2c_set_clientdata(client, chip);
        chip->dev = &client->dev;
-       chip->irq_base = -1;
        chip->chip_irq = client->irq;
        chip->chip_id = (enum max77620_chip_id)id->driver_data;
 
@@ -545,8 +544,8 @@ static int max77620_probe(struct i2c_client *client,
 
        max77620_top_irq_chip.irq_drv_data = chip;
        ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq,
-                                      IRQF_ONESHOT | IRQF_SHARED,
-                                      chip->irq_base, &max77620_top_irq_chip,
+                                      IRQF_ONESHOT | IRQF_SHARED, 0,
+                                      &max77620_top_irq_chip,
                                       &chip->top_irq_data);
        if (ret < 0) {
                dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret);
index 12ba157..f552ef5 100644 (file)
@@ -329,7 +329,6 @@ struct max77620_chip {
        struct regmap *rmap;
 
        int chip_irq;
-       int irq_base;
 
        /* chip id */
        enum max77620_chip_id chip_id;