diff mbox

[RFT,OMAP1,7/8] gpio: omap: get rid of omap_irq_to_gpio()

Message ID 1426785944-17255-8-git-send-email-grygorii.strashko@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Grygorii.Strashko@linaro.org March 19, 2015, 5:25 p.m. UTC
From: Grygorii Strashko <grygorii.strashko@linaro.org>

Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing.
Do it ;)

Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

Comments

Javier Martinez Canillas March 20, 2015, 6:56 p.m. UTC | #1
Hello Grygorii,

On Thu, Mar 19, 2015 at 6:25 PM,  <grygorii.strashko@linaro.org> wrote:
> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing.
> Do it ;)
>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

I don't have access to OMAP1 boards to test but Tony did it o an
osk5912 and Aaro can confirm that it doesn't cause regressions on
other OMAP1 boards.

Thanks a lot for the cleanup.

Acked-by: Javier Martinez Canillas <javier@dowhile0.org>

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Grygorii.Strashko@linaro.org March 20, 2015, 8:39 p.m. UTC | #2
On 03/20/2015 08:56 PM, Javier Martinez Canillas wrote:
> Hello Grygorii,
> 
> On Thu, Mar 19, 2015 at 6:25 PM,  <grygorii.strashko@linaro.org> wrote:
>> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>>
>> Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing.
>> Do it ;)
>>
>> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
> 
> I don't have access to OMAP1 boards to test but Tony did it o an
> osk5912 and Aaro can confirm that it doesn't cause regressions on
> other OMAP1 boards.

Thanks. But could you clarify one point to me please? 
"Aaro can confirm that it doesn't cause regressions on
other OMAP1 boards" - Does It mean I can add his Tested-by?
Or I still have to wait for his direct reply? 
Just to avoid any confusions ;)

> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
>
Javier Martinez Canillas March 20, 2015, 11:44 p.m. UTC | #3
Hello Grygorii,

On Fri, Mar 20, 2015 at 9:39 PM, Grygorii.Strashko@linaro.org
<grygorii.strashko@linaro.org> wrote:
> On 03/20/2015 08:56 PM, Javier Martinez Canillas wrote:
>> Hello Grygorii,
>>
>> On Thu, Mar 19, 2015 at 6:25 PM,  <grygorii.strashko@linaro.org> wrote:
>>> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>>>
>>> Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing.
>>> Do it ;)
>>>
>>> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
>>
>> I don't have access to OMAP1 boards to test but Tony did it o an
>> osk5912 and Aaro can confirm that it doesn't cause regressions on
>> other OMAP1 boards.
>
> Thanks. But could you clarify one point to me please?
> "Aaro can confirm that it doesn't cause regressions on
> other OMAP1 boards" - Does It mean I can add his Tested-by?
> Or I still have to wait for his direct reply?
> Just to avoid any confusions ;)
>

I meant that as far as I know Aaro has access to more OMAP1 systems so
he should be able to test that no regressions are added for those. But
I don't know if he would be able to test and I think your cleanups are
good so that's why I acked the patches.

Sorry for the confusion.

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index dd7934a..615e950 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -89,11 +89,6 @@  struct gpio_bank {
 
 static void omap_gpio_unmask_irq(struct irq_data *d);
 
-static int omap_irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq)
-{
-	return bank->chip.base + gpio_irq;
-}
-
 static inline struct gpio_bank *omap_irq_data_get_bank(struct irq_data *d)
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
@@ -490,22 +485,21 @@  static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned offset)
 static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned gpio = 0;
 	int retval;
 	unsigned long flags;
-	unsigned offset;
+	unsigned offset = d->hwirq;
 
 	if (!BANK_USED(bank))
 		pm_runtime_get_sync(bank->dev);
 
 #ifdef CONFIG_ARCH_OMAP1
-	if (d->irq > IH_MPUIO_BASE)
+	if (d->irq > IH_MPUIO_BASE) {
+		unsigned gpio = 0;
 		gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE);
+		offset = GPIO_INDEX(bank, gpio);
+	}
 #endif
 
-	if (!gpio)
-		gpio = omap_irq_to_gpio(bank, d->hwirq);
-
 	if (type & ~IRQ_TYPE_SENSE_MASK)
 		return -EINVAL;
 
@@ -514,7 +508,6 @@  static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 		return -EINVAL;
 
 	spin_lock_irqsave(&bank->lock, flags);
-	offset = GPIO_INDEX(bank, gpio);
 	retval = omap_set_gpio_triggering(bank, offset, type);
 	omap_gpio_init_irq(bank, offset);
 	if (!omap_gpio_is_input(bank, offset)) {