[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd9QUCcUoPLUW3kkJC0h=mPUqHNqNJPY74gDGSu67t8Hw@mail.gmail.com>
Date: Wed, 18 Nov 2020 11:56:53 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Cc: "Enrico Weigelt, metux IT consult" <info@...ux.net>,
Jonathan Cameron <jic23@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
linux-tegra@...r.kernel.org,
Thierry Reding <thierry.reding@...il.com>,
Alban Bedel <albeu@...e.fr>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Lee Jones <lee.jones@...aro.org>,
Florian Fainelli <f.fainelli@...il.com>,
Kevin Hilman <khilman@...nel.org>, zhang.lyra@...il.com,
Marek Behún <marek.behun@....cz>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>,
dl-linux-imx <linux-imx@....com>, orsonzhai@...il.com,
Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>,
linux-pwm@...r.kernel.org,
Grygorii Strashko <grygorii.strashko@...com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Sascha Hauer <s.hauer@...gutronix.de>,
Vladimir Zapolskiy <vz@...ia.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Fabio Estevam <festevam@...il.com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Linux OMAP Mailing List <linux-omap@...r.kernel.org>,
Hoan Tran <hoan@...amperecomputing.com>,
Scott Branden <sbranden@...adcom.com>,
Andrew Jeffery <andrew@...id.au>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Serge Semin <fancer.lancer@...il.com>,
Sascha Hauer <kernel@...gutronix.de>, baolin.wang7@...il.com,
Shawn Guo <shawnguo@...nel.org>
Subject: Re: [PATCH] drivers: gpio: use of_match_ptr() and ACPI_PTR() macros
On Wed, Nov 18, 2020 at 11:54 AM Uwe Kleine-König
<u.kleine-koenig@...gutronix.de> wrote:
> On Tue, Nov 17, 2020 at 06:45:37PM +0200, Andy Shevchenko wrote:
> > On Tue, Nov 17, 2020 at 5:45 PM Enrico Weigelt, metux IT consult
> > <info@...ux.net> wrote:
> > >
> > > The of_match_ptr(foo) macro evaluates to foo, only if
> > > CONFIG_OF is set, otherwise to NULL. Same does ACPI_PTR with
> > > CONFIG_ACPI. That's very helpful for drivers that can be used
> > > with or without oftree / acpi.
> > >
> > > Even though most of the drivers touched here probably don't
> > > actually need that, it's also nice for consistency to make it
> > > the de-facto standard and change all drivers to use the
> > > of_match_ptr() and ACPI_PTR() macros.
> > >
> > > A nice side effect: in some situations, when compiled w/o
> > > CONFIG_OF/CONFIG_ACPI, the corresponding match tables could
> > > automatically become unreferenced and optimized-away by the
> > > compiler, w/o explicitly cluttering the code w/ ifdef's.
> >
> > NAK.
> >
> > It prevents using DT-enabled drivers on ACPI based platforms.
>
> So a system without CONFIG_OF might still make use of .of_match_table?
Yep!
> If so: TIL ...
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists