staging: fbtft: add spi_device_id table
Subsystems (3)
PATCH 1/1 staging: fbtft: add spi_device_id table
After 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT compatible") we need the following to make the SPI core happy.
Works for me with a SH1106-based OLED display.
--- drivers/staging/fbtft/fbtft.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/staging/fbtft/fbtft.h +7 -0
@@ -307,12 +307,19 @@ static const struct of_device_id dt_ids[] = { \ \MODULE_DEVICE_TABLE (of, dt_ids); \ \ +static const struct spi_device_id spi_ids[] = { \ + { .name = _compatible }, \ + {}, \ +}; \ + \ +MODULE_DEVICE_TABLE (spi, spi_ids); \ \static struct spi_driver fbtft_driver_spi_driver = { \ .driver = { \ .name = _name, \ .of_match_table = dt_ids, \ }, \ + .id_table = spi_ids, \ .probe = fbtft_driver_probe_spi, \ .remove = fbtft_driver_remove_spi, \ }; \
Signature · 1 line
2.34.0
Hi Heiner,
Quoted 6 lines · Heiner Kallweit
After
5fa6863ba692("spi: Check we have aspi_device_idfor each DT compatible") we need the following to make the SPI core happy.Works for me with a SH1106-based OLED display.
Signed-off-by Heiner Kallweit <[email protected]>
Thanks for your patch!
drivers/staging/fbtft/fbtft.h static const struct of_device_id dt_ids[] = { \ · line 311
Quoted 8 lines
drivers/staging/fbtft/fbtft.h +2
-0@@ -307,12 +307,19 @@ static const struct of_device_id dt_ids[] = { \ \MODULE_DEVICE_TABLE (of, dt_ids); \ \ +static const struct spi_device_id spi_ids[] = { \ + { .name = _compatible }, \
Shouldn't this be the part of _compatible after the "<vendor>," prefix?
Quoted 4 lines
drivers/staging/fbtft/fbtft.h +4
-0+ {}, \ +}; \ + \ +MODULE_DEVICE_TABLE (spi, spi_ids); \
drivers/staging/fbtft/fbtft.h static const struct of_device_id dt_ids[] = { \ · line 325
Quoted 10 lines
drivers/staging/fbtft/fbtft.h +1
-0\static struct spi_driver fbtft_driver_spi_driver = { \ .driver = { \ .name = _name, \ .of_match_table = dt_ids, \ }, \ + .id_table = spi_ids, \ .probe = fbtft_driver_probe_spi, \ .remove = fbtft_driver_remove_spi, \ }; \
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 12 lines · Geert Uytterhoeven
Hi Heiner,
Quoted 6 lines · Heiner Kallweit
After
5fa6863ba692("spi: Check we have aspi_device_idfor each DT compatible") we need the following to make the SPI core happy.Works for me with a SH1106-based OLED display.
Signed-off-by Heiner Kallweit <[email protected]>Thanks for your patch!
Quoted 11 lines
drivers/staging/fbtft/fbtft.h static const struct of_device_id dt_ids[] = { \ · line 311
Quoted 8 lines
drivers/staging/fbtft/fbtft.h +2
-0@@ -307,12 +307,19 @@ static const struct of_device_id dt_ids[] = { \ \MODULE_DEVICE_TABLE (of, dt_ids); \ \ +static const struct spi_device_id spi_ids[] = { \ + { .name = _compatible }, \Shouldn't this be the part of
_compatibleafter the "<vendor>," prefix?
You're right. I was fooled by a new bug in SPI core that made the warning suddenly disappear:
https://patchwork.kernel.org/project/spi-devel-general/patch/[email protected]/
Quoted 26 lines
Quoted 4 lines
drivers/staging/fbtft/fbtft.h +4
-0+ {}, \ +}; \ + \ +MODULE_DEVICE_TABLE (spi, spi_ids); \drivers/staging/fbtft/fbtft.h static const struct of_device_id dt_ids[] = { \ · line 325
Quoted 10 lines
drivers/staging/fbtft/fbtft.h +1
-0\static struct spi_driver fbtft_driver_spi_driver = { \ .driver = { \ .name = _name, \ .of_match_table = dt_ids, \ }, \ + .id_table = spi_ids, \ .probe = fbtft_driver_probe_spi, \ .remove = fbtft_driver_remove_spi, \ }; \Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds