[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160425101101.GC20630@ulmo.ba.sec>
Date: Mon, 25 Apr 2016 12:11:01 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Laxman Dewangan <ldewangan@...dia.com>
Cc: swarren@...dotorg.org, linus.walleij@...aro.org, gnurou@...il.com,
linux-gpio@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V4 3/4] gpio: tegra: Get rid of all file scoped global
variables
On Mon, Apr 25, 2016 at 03:23:22PM +0530, Laxman Dewangan wrote:
>
> On Monday 25 April 2016 03:30 PM, Thierry Reding wrote:
> > * PGP Signed by an unknown key
> >
> > On Fri, Apr 22, 2016 at 03:39:13PM +0530, Laxman Dewangan wrote:
> > [...]
> > > diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
> > [...]
> > > static struct gpio_chip tegra_gpio_chip = {
> > This variable is still file-scoped. Why not get rid of it at the same
> > time? It's rather pointless to remove all file-scoped variables except a
> > single one, because now the driver still isn't properly equipped to deal
> > with multiple instances (however theoretical that may be).
> >
>
> Yaah, Alex also pointed that to have the instance of gpio_chip in
> tegra_gpio_info and then do as
> tgi->gc = tegra_gpio_chip.
>
>
> same for irq_chip also.
>
>
> I hope this will resolve the concern.
An alternative would be to do away with tegra_gpio_chip altogether and
instead assign the fields directly within ->probe(). Both patterns seem
to be used in drivers/gpio, with the latter one being slightly more
common.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists