linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	Yalin.Wang@sonymobile.com, linux-gpio@vger.kernel.org,
	Grygorii Strashko <grygorii.strashko@ti.com>
Subject: [RFC/RFT PATCH 2/2] gpiolib: irqchip: get rid of irq_base
Date: Thu, 25 Sep 2014 19:09:24 +0300	[thread overview]
Message-ID: <1411661364-19620-2-git-send-email-grygorii.strashko@ti.com> (raw)
In-Reply-To: <1411661364-19620-1-git-send-email-grygorii.strashko@ti.com>

Remove irq_base from struct gpio_chip, as it is seems to
be unused.
Aslo, using this field by drivers is unsafe because it's
uncompatible with Sparse IRQ feature.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
Hi Linus,

I've not found users of this field in drivers/gpio/ folder,
so I've decided to created this patch to get more comments.

 drivers/gpio/gpiolib.c      | 9 +--------
 include/linux/gpio/driver.h | 1 -
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index f6bf368..8aa84d5 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -605,15 +605,8 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
 	 * any gpiochip calls. If the first_irq was zero, this is
 	 * necessary to allocate descriptors for all IRQs.
 	 */
-	for (offset = 0; offset < gpiochip->ngpio; offset++) {
+	for (offset = 0; offset < gpiochip->ngpio; offset++)
 		irq_base = irq_create_mapping(gpiochip->irqdomain, offset);
-		if (offset == 0)
-			/*
-			 * Store the base into the gpiochip to be used when
-			 * unmapping the irqs.
-			 */
-			gpiochip->irq_base = irq_base;
-	}
 
 	acpi_gpiochip_request_interrupts(gpiochip);
 
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index e78a237..976276a 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -110,7 +110,6 @@ struct gpio_chip {
 	 */
 	struct irq_chip		*irqchip;
 	struct irq_domain	*irqdomain;
-	unsigned int		irq_base;
 	irq_flow_handler_t	irq_handler;
 	unsigned int		irq_default_type;
 #endif
-- 
1.9.1


  reply	other threads:[~2014-09-25 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 16:09 [PATCH 1/2] gpiolib: irqchip: use irq_find_mapping while removing irqchip Grygorii Strashko
2014-09-25 16:09 ` Grygorii Strashko [this message]
2014-09-26  8:44   ` [RFC/RFT PATCH 2/2] gpiolib: irqchip: get rid of irq_base Linus Walleij
2014-09-26 10:44     ` Grygorii Strashko
2014-09-26 12:33       ` Linus Walleij
2014-09-26  8:40 ` [PATCH 1/2] gpiolib: irqchip: use irq_find_mapping while removing irqchip Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411661364-19620-2-git-send-email-grygorii.strashko@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=Yalin.Wang@sonymobile.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).