Commit a362605b authored by Linus Walleij's avatar Linus Walleij

gpio/tc3589x: convert to use the simple irqdomain

The special checks for whether we have a base IRQ offset or not
is surplus if we use the simple IRQ domain. The IRQ offset
zero will be interpreted as a linear domain case.

Plus this makes sure we allocate descriptors where need be, or
warn if they are preallocated with SPARSE_IRQ.

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 7385500a
...@@ -292,17 +292,15 @@ static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio, ...@@ -292,17 +292,15 @@ static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio,
{ {
int base = tc3589x_gpio->irq_base; int base = tc3589x_gpio->irq_base;
if (base) { /*
tc3589x_gpio->domain = irq_domain_add_legacy( * If this results in a linear domain, irq_create_mapping() will
NULL, tc3589x_gpio->chip.ngpio, base, * take care of allocating IRQ descriptors at runtime. When a base
0, &tc3589x_irq_ops, tc3589x_gpio); * is provided, the IRQ descriptors will be allocated when the
} * domain is instantiated.
else { */
tc3589x_gpio->domain = irq_domain_add_linear( tc3589x_gpio->domain = irq_domain_add_simple(np,
np, tc3589x_gpio->chip.ngpio, tc3589x_gpio->chip.ngpio, base, &tc3589x_irq_ops,
&tc3589x_irq_ops, tc3589x_gpio); tc3589x_gpio);
}
if (!tc3589x_gpio->domain) { if (!tc3589x_gpio->domain) {
dev_err(tc3589x_gpio->dev, "Failed to create irqdomain\n"); dev_err(tc3589x_gpio->dev, "Failed to create irqdomain\n");
return -ENOSYS; return -ENOSYS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment