lkml.org 
[lkml]   [2022]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 4/5] platform/chrome: cros_kbd_led_backlight: support OF match
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.

\
 
 \ /
  Last update: 2022-05-25 05:34    [W:0.092 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site