From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755309AbdJIVWd (ORCPT ); Mon, 9 Oct 2017 17:22:33 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:55890 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754161AbdJIVWb (ORCPT ); Mon, 9 Oct 2017 17:22:31 -0400 Subject: Re: [PATCH v2 15/16] gpio: tegra: Use banked GPIO infrastructure To: Thierry Reding , Linus Walleij CC: Jonathan Hunter , , , References: <20170928095628.21966-1-thierry.reding@gmail.com> <20170928095628.21966-16-thierry.reding@gmail.com> From: Grygorii Strashko Message-ID: Date: Mon, 9 Oct 2017 16:22:29 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170928095628.21966-16-thierry.reding@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.59.147] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/28/2017 04:56 AM, Thierry Reding wrote: > From: Thierry Reding > > Convert the Tegra GPIO driver to use the banked GPIO infrastructure, > which simplifies some parts of the driver. > > Signed-off-by: Thierry Reding > --- > drivers/gpio/Kconfig | 1 + > drivers/gpio/gpio-tegra.c | 203 ++++++++++++++++++++++------------------------ > 2 files changed, 98 insertions(+), 106 deletions(-) > > diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig > index db3e446ad9b3..458157d6d491 100644 > --- a/drivers/gpio/Kconfig > +++ b/drivers/gpio/Kconfig > @@ -439,6 +439,7 @@ config GPIO_TEGRA > default ARCH_TEGRA > depends on ARCH_TEGRA || COMPILE_TEST ... > @@ -616,76 +617,66 @@ static int tegra_gpio_probe(struct platform_device *pdev) > tgi->ic.irq_set_wake = tegra_gpio_irq_set_wake; > #endif > > + irq = &tgi->gc.irq; > + irq->chip = &tgi->ic; > + irq->handler = handle_simple_irq; > + irq->lock_key = &tegra_gpio_lock_class; As per current gpiolib design lockdep lock_class_key is assigned automatically and hidden from gpiolib users. Why do you need to do the same manually? > + irq->default_type = IRQ_TYPE_NONE; > + irq->parent_handler = gpio_irq_chip_banked_chained_handler; > + irq->update_bank = tegra_gpio_update_bank; > + > + irq->parents = devm_kcalloc(&pdev->dev, tgi->gc.num_banks, > + sizeof(unsigned int), GFP_KERNEL); > + if (!irq->parents) > + return -ENOMEM; > + ... > > tegra_gpio_debuginit(tgi); > > -- regards, -grygorii