diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2020-07-16 11:28:35 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-07-17 14:03:38 +0200 |
commit | 80606cb24161d504acb4d89f406d68f72196575e (patch) | |
tree | 1095a29272df4aadc36789fb6db095350c30e163 /drivers/gpio/gpio-max77620.c | |
parent | 761b5c30c206ba1788c6ceb23e5812f319548b52 (diff) |
gpio: max77620: Use helper variable and clarify
Most other drivers fill out the gpio_irq_chip using a
struct gpio_irq_chip *girq helper variable for ease of
reading.
We also make a habit of explicitly assigning NULL and
zero to the parent IRQs when using ordinary IRQ handlers
in the driver, mostly for code readability and
maintenance.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Cc: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20200716092835.69176-1-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpio/gpio-max77620.c')
-rw-r--r-- | drivers/gpio/gpio-max77620.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c index e090979659eb..7c0a9ef0b500 100644 --- a/drivers/gpio/gpio-max77620.c +++ b/drivers/gpio/gpio-max77620.c @@ -288,6 +288,7 @@ static int max77620_gpio_probe(struct platform_device *pdev) { struct max77620_chip *chip = dev_get_drvdata(pdev->dev.parent); struct max77620_gpio *mgpio; + struct gpio_irq_chip *girq; unsigned int gpio_irq; int ret; @@ -316,11 +317,16 @@ static int max77620_gpio_probe(struct platform_device *pdev) mgpio->gpio_chip.can_sleep = 1; mgpio->gpio_chip.base = -1; - mgpio->gpio_chip.irq.chip = &max77620_gpio_irqchip; - mgpio->gpio_chip.irq.default_type = IRQ_TYPE_NONE; - mgpio->gpio_chip.irq.handler = handle_edge_irq; - mgpio->gpio_chip.irq.init_hw = max77620_gpio_irq_init_hw, - mgpio->gpio_chip.irq.threaded = true; + girq = &mgpio->gpio_chip.irq; + girq->chip = &max77620_gpio_irqchip; + /* This will let us handle the parent IRQ in the driver */ + girq->parent_handler = NULL; + girq->num_parents = 0; + girq->parents = NULL; + girq->default_type = IRQ_TYPE_NONE; + girq->handler = handle_edge_irq; + girq->init_hw = max77620_gpio_irq_init_hw, + girq->threaded = true; platform_set_drvdata(pdev, mgpio); |