aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-tc3589x.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-10-16 13:43:53 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-10-26 03:42:22 -0400
commita362605b341d95e7209ead8052363cb28dda1c44 (patch)
tree8141907660c4b0f6aaab5cd0a6fe74cf0439ab5d /drivers/gpio/gpio-tc3589x.c
parent7385500a49b769c95438c111aff92110b06ff751 (diff)
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: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-tc3589x.c')
-rw-r--r--drivers/gpio/gpio-tc3589x.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 1e48317e70f..8c8447c7d2a 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -292,17 +292,15 @@ static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio,
292{ 292{
293 int base = tc3589x_gpio->irq_base; 293 int base = tc3589x_gpio->irq_base;
294 294
295 if (base) { 295 /*
296 tc3589x_gpio->domain = irq_domain_add_legacy( 296 * If this results in a linear domain, irq_create_mapping() will
297 NULL, tc3589x_gpio->chip.ngpio, base, 297 * take care of allocating IRQ descriptors at runtime. When a base
298 0, &tc3589x_irq_ops, tc3589x_gpio); 298 * is provided, the IRQ descriptors will be allocated when the
299 } 299 * domain is instantiated.
300 else { 300 */
301 tc3589x_gpio->domain = irq_domain_add_linear( 301 tc3589x_gpio->domain = irq_domain_add_simple(np,
302 np, tc3589x_gpio->chip.ngpio, 302 tc3589x_gpio->chip.ngpio, base, &tc3589x_irq_ops,
303 &tc3589x_irq_ops, tc3589x_gpio); 303 tc3589x_gpio);
304 }
305
306 if (!tc3589x_gpio->domain) { 304 if (!tc3589x_gpio->domain) {
307 dev_err(tc3589x_gpio->dev, "Failed to create irqdomain\n"); 305 dev_err(tc3589x_gpio->dev, "Failed to create irqdomain\n");
308 return -ENOSYS; 306 return -ENOSYS;