All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/7] gpio/mvebu: convert to use irq_domain_add_simple()
@ 2012-10-16 19:22 Linus Walleij
  0 siblings, 0 replies; only message in thread
From: Linus Walleij @ 2012-10-16 19:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Rob Herring, Grant Likely, Linus Walleij, Thomas Petazzoni,
	Sebastian Hesselbarth, Andrew Lunn

The MVEBU driver probably just wants a few IRQs. Using the simple
domain has the upside of allocating IRQ descriptors if need be,
especially in a SPARSE_IRQ environment.

Also replace one instance of irq_create_mapping() with
irq_find_mapping(), the domain is registered in probe() so
the irq is sure there to be found, no reason to ask for
on-the-fly remappings here.

Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-mvebu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 902af43..8fdeed2 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -257,7 +257,7 @@ static int mvebu_gpio_to_irq(struct gpio_chip *chip, unsigned pin)
 {
 	struct mvebu_gpio_chip *mvchip =
 		container_of(chip, struct mvebu_gpio_chip, chip);
-	return irq_create_mapping(mvchip->domain, pin);
+	return irq_find_mapping(mvchip->domain, pin);
 }
 
 /*
@@ -645,8 +645,8 @@ static int __devinit mvebu_gpio_probe(struct platform_device *pdev)
 			       IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
 
 	/* Setup irq domain on top of the generic chip. */
-	mvchip->domain = irq_domain_add_legacy(np, mvchip->chip.ngpio,
-					       mvchip->irqbase, 0,
+	mvchip->domain = irq_domain_add_simple(np, mvchip->chip.ngpio,
+					       mvchip->irqbase,
 					       &irq_domain_simple_ops,
 					       mvchip);
 	if (!mvchip->domain) {
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-16 19:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-16 19:22 [PATCH 3/7] gpio/mvebu: convert to use irq_domain_add_simple() Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.