From patchwork Wed Jan 5 06:47:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 452881 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p056lTqt003562 for ; Wed, 5 Jan 2011 06:47:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751298Ab1AEGr2 (ORCPT ); Wed, 5 Jan 2011 01:47:28 -0500 Received: from na3sys009aog108.obsmtp.com ([74.125.149.199]:46969 "EHLO na3sys009aog108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166Ab1AEGr2 (ORCPT ); Wed, 5 Jan 2011 01:47:28 -0500 Received: from source ([209.85.215.181]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKTSQT/8PlaE/nONFUzugYDTDioHEzdE49@postini.com; Tue, 04 Jan 2011 22:47:28 PST Received: by eyh6 with SMTP id 6so6024815eyh.12 for ; Tue, 04 Jan 2011 22:47:26 -0800 (PST) Received: by 10.213.105.74 with SMTP id s10mr10437745ebo.48.1294210046036; Tue, 04 Jan 2011 22:47:26 -0800 (PST) Received: from localhost (cs181221087.pp.htv.fi [82.181.221.87]) by mx.google.com with ESMTPS id x54sm195965eeh.23.2011.01.04.22.47.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 22:47:25 -0800 (PST) Date: Wed, 5 Jan 2011 08:47:22 +0200 From: Felipe Balbi To: Kevin Hilman Cc: Felipe Balbi , Tony Lindgren , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Russell King Subject: Re: [PATCH 1/4] arm: omap: gpio: don't access irq_desc array directly Message-ID: <20110105064722.GC2458@legolas.emea.dhcp.ti.com> Reply-To: balbi@ti.com References: <1294142577-28772-1-git-send-email-balbi@ti.com> <1294142577-28772-2-git-send-email-balbi@ti.com> <87r5cs42p1.fsf@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87r5cs42p1.fsf@ti.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 05 Jan 2011 06:47:50 +0000 (UTC) From 8d216ccac14e4eebf259d5b40ed2d239248710e1 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Wed, 5 Jan 2011 08:46:18 +0200 Subject: [PATCH] arm: omap: gpio: don't access irq_desc array directly Organization: Texas Instruments\n Instead of accessing the irq_desc array directly we can use irq_to_desc(irq). That will allow us to, if wanted, select SPARSE_IRQ and irq_descs will be added to a radix tree, instead of a array. Signed-off-by: Felipe Balbi --- arch/arm/plat-omap/gpio.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 1f98e0b..197a6c0 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -756,8 +756,10 @@ static int gpio_irq_type(unsigned irq, unsigned type) spin_lock_irqsave(&bank->lock, flags); retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); if (retval == 0) { - irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK; - irq_desc[irq].status |= type; + struct irq_desc *d = irq_to_desc(irq); + + d->status &= ~IRQ_TYPE_SENSE_MASK; + d->status |= type; } spin_unlock_irqrestore(&bank->lock, flags); @@ -1671,7 +1673,9 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank) for (j = bank->virtual_irq_start; j < bank->virtual_irq_start + bank_width; j++) { - lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class); + struct irq_desc *d = irq_to_desc(j); + + lockdep_set_class(&d->lock, &gpio_lock_class); set_irq_chip_data(j, bank); if (bank_is_mpuio(bank)) set_irq_chip(j, &mpuio_irq_chip); -- 1.7.3.4.598.g85356