From patchwork Fri Oct 13 15:49:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 825529 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="DrPazsWJ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yDByV5vM6z9t2V for ; Sat, 14 Oct 2017 02:50:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758344AbdJMPuo (ORCPT ); Fri, 13 Oct 2017 11:50:44 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:47770 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758564AbdJMPtn (ORCPT ); Fri, 13 Oct 2017 11:49:43 -0400 Received: by mail-qk0-f195.google.com with SMTP id m189so5516695qke.4; Fri, 13 Oct 2017 08:49:43 -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=Xt3BKbjhxcR6L+iOj0IlDYNlp0QEyTjLCEWQip8irnQ=; b=DrPazsWJLOs0bL7/IULQ0uRYKogGA2yRE79Gjrn0Yz5is96IGiVF5O3t6yYU7wpyGZ 2LcZkQzsVyT7XlvCBDh9RgT7EXEvpQxM5/NqoG8Mfmfob+t01SeHe3gedM//S6NOCsKI P89WvfW/whfJTf3YLU3I+qZwxaqJmZvaHyk7G7GHzZBn3VuAity5mPXcCFWY9SzpOtI4 h+BY6mMIGzdUJAYRnePITGb4cSyt/tmrWIuuceC94PkxUpWKrTAJmy3zAgwF0IsUr0Vu KD+6N+4++aKjDQ+Ff/6DZBB13G6SgPE3iDaJuDM8G+zIjdWGZ87xZ2Py/7Mw/a3SesHs KBOQ== 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=Xt3BKbjhxcR6L+iOj0IlDYNlp0QEyTjLCEWQip8irnQ=; b=RRNB7eSKD64/sBOw8Lxv+Nb+tjEC7dTOvdA9kBVS8RGSp/HLteEI7wvf1iWgcpJCpI J22q31z/Rec5cYsqAvRi/gbgl9u6PwbinyN9Hgp7hSPq4iIZewB38j3F4Jhiy4hViU6p yvbYHpOqGtz1/JWzLSCJkF2EXQ3R0lwF0TmIPXt/yU/346Lc+lViCjJXAJPI32BZ5Scg KNydwCbCaxmp4ocIYJGV646chLMldFdq3M+gmktEf/O8vAgIYW1oiOpg80XtqDrl0Vk0 s9XuXemc89qY+lEtvlwI+aQd5X4ZjE//yTBNeKdQWoQNLs0v97RhcdFpuv0W4yVgDehc myPw== X-Gm-Message-State: AMCzsaVgxQz2q4z7wY7c3yrs7HCzP7zXK8O5V8YFwXZet1bsERPv1H6/ 5yG6xEv7z8zJD+wO8HrrhGg= X-Google-Smtp-Source: AOwi7QDwtM/9Rsxfm6KhI/Jgp/bfTrspUqKmHS+gVvLWb9Il/fUrke1tgOXUajhAtoNoPmL2DrtNvw== X-Received: by 10.55.39.5 with SMTP id n5mr2401439qkn.106.1507909782701; Fri, 13 Oct 2017 08:49:42 -0700 (PDT) Received: from localhost (p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de. [2003:e4:1be4:fd00:cead:5b94:e1cf:d280]) by smtp.gmail.com with ESMTPSA id e7sm700719qkf.73.2017.10.13.08.49.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 08:49:42 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Jonathan Hunter , Grygorii Strashko , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 10/13] gpio: Move lock_key into struct gpio_irq_chip Date: Fri, 13 Oct 2017 17:49:10 +0200 Message-Id: <20171013154913.29448-11-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013154913.29448-1-thierry.reding@gmail.com> References: <20171013154913.29448-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 4407423dc29b..eb487af120d9 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1640,7 +1640,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) @@ -1825,7 +1825,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 fc25fb070843..4ae8dd945617 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -70,6 +70,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: * @@ -191,7 +198,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. @@ -258,7 +264,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: