[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yo5HLJs81/KoXSBT@google.com>
Date: Wed, 25 May 2022 08:11:40 -0700
From: Matthias Kaehlcke <mka@...omium.org>
To: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: bleung@...omium.org, groeck@...omium.org, robh+dt@...nel.org,
chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, Guenter Roeck <linux@...ck-us.net>
Subject: Re: [PATCH v4 4/5] platform/chrome: cros_kbd_led_backlight: support
OF match
On Wed, May 25, 2022 at 11:33:25AM +0800, Tzung-Bi Shih wrote:
> On Tue, May 24, 2022 at 01:08:00PM -0700, Matthias Kaehlcke wrote:
> > On Mon, May 23, 2022 at 05:08:21PM +0800, Tzung-Bi Shih wrote:
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id keyboard_led_of_match[] = {
> > > + {
> > > + .compatible = "google,cros-kbd-led-backlight",
> > > + },
> > > + {}
> > > +};
> > > +MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
> > > +#endif
> > > +
> > > static struct platform_driver keyboard_led_driver = {
> > > .driver = {
> > > .name = "chromeos-keyboard-leds",
> > > .acpi_match_table = ACPI_PTR(keyboard_led_acpi_match),
> > > + .of_match_table = of_match_ptr(keyboard_led_of_match),
> >
> > You need to put this assignment inside an '#ifdef CONFIG_OF' block,
> > otherwise the compiler won't find 'keyboard_led_of_match' when
> > CONFIG_OF isn't set.
>
> It doesn't need as of_match_ptr() already guarded it.
I learned something new today :)
Reviewed-by: Matthias Kaehlcke <mka@...omium.org>
Powered by blists - more mailing lists