From patchwork Thu Sep 25 16:09:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 393381 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5871F140188 for ; Fri, 26 Sep 2014 02:09:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753639AbaIYQJi (ORCPT ); Thu, 25 Sep 2014 12:09:38 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:60897 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753636AbaIYQJh (ORCPT ); Thu, 25 Sep 2014 12:09:37 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s8PG9UfS025756; Thu, 25 Sep 2014 11:09:30 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s8PG9Us7021159; Thu, 25 Sep 2014 11:09:30 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Thu, 25 Sep 2014 11:09:31 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s8PG9T50022055; Thu, 25 Sep 2014 11:09:30 -0500 From: Grygorii Strashko To: Linus Walleij CC: Alexandre Courbot , , , Grygorii Strashko Subject: [RFC/RFT PATCH 2/2] gpiolib: irqchip: get rid of irq_base Date: Thu, 25 Sep 2014 19:09:24 +0300 Message-ID: <1411661364-19620-2-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411661364-19620-1-git-send-email-grygorii.strashko@ti.com> References: <1411661364-19620-1-git-send-email-grygorii.strashko@ti.com> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 --- 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