From patchwork Tue Nov 7 18:15:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 835411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SLNqDFB6"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWd3S4ftDz9t2m for ; Wed, 8 Nov 2017 05:18:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758615AbdKGSSQ (ORCPT ); Tue, 7 Nov 2017 13:18:16 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:52040 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756058AbdKGSQQ (ORCPT ); Tue, 7 Nov 2017 13:16:16 -0500 Received: by mail-wm0-f68.google.com with SMTP id b9so5863633wmh.0; Tue, 07 Nov 2017 10:16:15 -0800 (PST) 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=8bv5c4Ec9uTr2FGWqxM2TQtnUhVJx6k/pqVtE0EuLlI=; b=SLNqDFB6h1WjlMF5VHF8R/p9OA+zjiyPK5kp2HUYoWuNo9NxS0lkLPZl87Z3pPGQM2 rsA0bnxnhE33Fn7RL+X4IqMGncWH0tiPtQGC2nWm/xO8BdAeE/dM60UAX9D8a4JGYGOW NKS9gl+6gU1BZGBdM7eUt5nRZulHNAE7q0FXI5oF7Y/hjqQ77ragnDHHbicBTHCQyVvM gXpNliQieS3H183JecN/D/YJ43Rh/1SxYK6gkvtZFTOOVBoVH9VhiDtmYx5B4har1eF1 rXmbYJxXEzB1ptnE80zrIPidEmV/9SEU79X73GT6aU9e+VvidfN40l/VJWr9uhp9SpIc g9lw== 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=8bv5c4Ec9uTr2FGWqxM2TQtnUhVJx6k/pqVtE0EuLlI=; b=tFSlnLqFqd+QG7fo3ZiZmwF6EJvH37PXmwN4YqEehukHI+SmE0xFjXr1WWVcWYrLCa tsNE8uXs4zL5DfvrWSbVv7PvAd5NQfTXxxSYT2mPeYsHmXvquy8ybJEUiadn40/zr/x0 fFvPyP6Il4LDjYa1XNFJ0583vlxiCjApEqr6CXEnmUNSwZLcQlW1x98RNTmDK84tUjb3 q+kJQfAy/ntRfPodq5Dz8F50iu39MICb+JSQ/FMxF8tAC6pfyRflqey/2HyxiWUEbzVf A2CE/yx8HUNhG7x8f/0Bba5ZFtHcNTEljPLQEhudjqrSKl2zJIfCGnzMhZPV4ZoB5oY1 W0aA== X-Gm-Message-State: AJaThX4hT1Z0rtihwOBLFvEOW0OwWV6csiH2YnmrCSs3CFSh+1V1Dxkc 1JKcwRtgfd1D6I/V/HFeZjU= X-Google-Smtp-Source: ABhQp+RSoGw2sv4YlFexsj/hbXu5EQtDhiASvK3J6QBaiRJzUfEiGZEDofrzNoQqwUaUEnnwx7RS6g== X-Received: by 10.28.52.148 with SMTP id b142mr45959wma.154.1510078575031; Tue, 07 Nov 2017 10:16:15 -0800 (PST) Received: from localhost (p200300E41BC8E9001FF851737372D2C2.dip0.t-ipconnect.de. [2003:e4:1bc8:e900:1ff8:5173:7372:d2c2]) by smtp.gmail.com with ESMTPSA id m37sm2547020wrm.4.2017.11.07.10.16.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 10:16:14 -0800 (PST) From: Thierry Reding To: Linus Walleij , Grygorii Strashko Cc: Jonathan Hunter , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 09/15] gpio: Move lock_key into struct gpio_irq_chip Date: Tue, 7 Nov 2017 19:15:53 +0100 Message-Id: <20171107181559.6318-10-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171107181559.6318-1-thierry.reding@gmail.com> References: <20171107181559.6318-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 | 4 ++-- include/linux/gpio/driver.h | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 52cb24b16ae3..9d98ff2f4e0e 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1646,7 +1646,7 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, * This lock class tells lockdep that GPIO irqs are in a different * category than their parents, so it won't report false recursion. */ - irq_set_lockdep_class(irq, chip->lock_key); + irq_set_lockdep_class(irq, chip->irq.lock_key); 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) @@ -1830,7 +1830,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, gpiochip->irq.handler = handler; gpiochip->irq.default_type = type; gpiochip->to_irq = gpiochip_to_irq; - gpiochip->lock_key = lock_key; + gpiochip->irq.lock_key = lock_key; gpiochip->irq.domain = irq_domain_add_simple(of_node, gpiochip->ngpio, first_irq, &gpiochip_domain_ops, gpiochip); diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 243c8b585160..c390c8165583 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -63,6 +63,13 @@ struct gpio_irq_chip { */ unsigned int default_type; + /** + * @lock_key: + * + * Per GPIO IRQ chip lockdep class. + */ + struct lock_class_key *lock_key; + /** * @parent_handler: * @@ -186,7 +193,6 @@ static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip) * safely. * @bgpio_dir: shadowed direction register for generic GPIO to clear/set * direction safely. - * @lock_key: per GPIO IRQ chip lockdep class * * A gpio_chip can help platforms abstract various sources of GPIOs so * they can all be accessed through a common programing interface. @@ -256,7 +262,6 @@ struct gpio_chip { * With CONFIG_GPIOLIB_IRQCHIP we get an irqchip inside the gpiolib * to handle IRQs for most practical cases. */ - struct lock_class_key *lock_key; /** * @irq: