From patchwork Mon Apr 3 16:05:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 746555 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 3vxcQr1Jhmz9s7s for ; Tue, 4 Apr 2017 02:05:56 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZcQXJXta"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbdDCQFv (ORCPT ); Mon, 3 Apr 2017 12:05:51 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33344 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753984AbdDCQFt (ORCPT ); Mon, 3 Apr 2017 12:05:49 -0400 Received: by mail-wr0-f195.google.com with SMTP id u18so34808886wrc.0; Mon, 03 Apr 2017 09:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xN1fiVqe6TpV3BWhgp+ize8qlC/z3fk26Sgvgopzfzs=; b=ZcQXJXtaPxB2peHbcOTUADoypbyIOBOwj9i1TusX1HOIoSr3CZ17vuieY/f5/kl7zq UCl+pmzSWKBwkY2+XW4+B1tkdWuYUndheVmL+qaU0SQBN1Jstjwr6KUBEZ4vo/VdZVqG /nZwPGwS29lSH80z6xiuzk1/239HVxunEoC3A8fwm+FxWs76xRAbdpM9KRGMhu8OfmEl Cv5LmQ3ARqlQO0ucESauy/Q3LFZHJEBHdTPGiR7f06WFy6bCuLFZOzaSUc0GLLWAYh47 w3Il66kcnKzg7ujrET72bW1uJqOCcvucYq3eQYh5j0jWnjQ103dLG8ieEP/B9KWI2n21 P1VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xN1fiVqe6TpV3BWhgp+ize8qlC/z3fk26Sgvgopzfzs=; b=P9H711p2ebWx9EFgFuzlff47cD+YVL+rrYPNwPrgesgFpi8YJu/nkp/aXHSROZMWqm CM8gCttLhE2HAjLNoGf81un/g9Fr988TdR/8hcn1ezjSz8CeJVe62OBSgXFPwHWzeXwe eHBD8nuFeYNytASa47jYmboydIFIBSypGq5Nj8SecNgXR299zS8mash7FMOW25p5Uyc4 UlBr0K+HxRM0MHU5pKVem19/B8T+tNhCEXX3ovRIzIKnoqVUHx2Z4rVED5EK0hJw1qwF DlR7j9Kyf3eSqPXweNh63At8gzs0/fz5ir6O/DLY65IeA6XecNFVokvbLpfa98JrJsjs tX9A== X-Gm-Message-State: AFeK/H2UzO2k3FNHenvGsITTwIKrkOTBIQ3L47UEPkORxcl5K/uAt0bcNfz4tHK0x5hXCA== X-Received: by 10.28.111.136 with SMTP id c8mr10547007wmi.128.1491235548230; Mon, 03 Apr 2017 09:05:48 -0700 (PDT) Received: from localhost (port-24830.pppoe.wtnet.de. [46.59.158.181]) by smtp.gmail.com with ESMTPSA id k63sm14840617wmf.9.2017.04.03.09.05.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Apr 2017 09:05:47 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Alexandre Courbot , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 10/12] gpio: Move irq_handler to struct gpio_irq_chip Date: Mon, 3 Apr 2017 18:05:30 +0200 Message-Id: <20170403160532.20282-11-thierry.reding@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170403160532.20282-1-thierry.reding@gmail.com> References: <20170403160532.20282-1-thierry.reding@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding In order to consolidate the multiple ways to associate an IRQ chip with a GPIO chip, move more fields into the new struct gpio_irq_chip. Signed-off-by: Thierry Reding --- drivers/gpio/gpiolib.c | 6 ++---- include/linux/gpio/driver.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index cb4b35157aca..3b251d5c0e1a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1619,7 +1619,7 @@ int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, * category than their parents, so it won't report false recursion. */ irq_set_lockdep_class(irq, chip->irq.lock_key); - irq_set_chip_and_handler(irq, chip->irq.chip, chip->irq_handler); + irq_set_chip_and_handler(irq, chip->irq.chip, chip->irq.handler); /* Chips that use nested thread handlers have them marked */ if (chip->irq.nested) irq_set_nested_thread(irq, 1); @@ -1733,8 +1733,6 @@ static int gpiochip_add_irqchip(struct gpio_chip *gpiochip) type = IRQ_TYPE_NONE; } - gpiochip->irq_handler = gpiochip->irq.handler; - gpiochip->to_irq = gpiochip_to_irq; gpiochip->irq.default_type = type; @@ -1921,7 +1919,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, } gpiochip->irq.chip = irqchip; - gpiochip->irq_handler = handler; + gpiochip->irq.handler = handler; gpiochip->irq.default_type = type; gpiochip->to_irq = gpiochip_to_irq; gpiochip->irq.lock_key = lock_key; diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 4bc5b4b9cf0b..91aa808052f1 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -28,7 +28,8 @@ struct module; * @domain: interrupt translation domain; responsible for mapping * between GPIO hwirq number and linux irq number * @domain_ops: table of interrupt domain operations for this IRQ chip - * @handler: the interrupt handler for the GPIO chip's parent interrupts + * @handler: the IRQ handler to use (often a predefined IRQ core function) for + * GPIO IRQs, provided by GPIO driver * @lock_key: per GPIO IRQ chip lockdep class * @default_type: default IRQ triggering type applied during GPIO driver * initialization, provided by GPIO driver @@ -125,8 +126,6 @@ struct gpio_irq_chip { * @bgpio_dir: shadowed direction register for generic GPIO to clear/set * direction safely. * @irq_base: first linux IRQ number assigned to GPIO IRQ chip (deprecated) - * @irq_handler: the irq handler to use (often a predefined irq core function) - * for GPIO IRQs, provided by GPIO driver * * A gpio_chip can help platforms abstract various sources of GPIOs so * they can all be accessed through a common programing interface. @@ -194,7 +193,6 @@ struct gpio_chip { * to handle IRQs for most practical cases. */ unsigned int irq_base; - irq_flow_handler_t irq_handler; struct gpio_irq_chip irq; #endif