Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: sca3300: Silence no spi_device_id warning

SPI devices use the spi_device_id for module autoloading even on
systems using device tree, after commit 5fa6863ba692 ("spi: Check
we have a spi_device_id for each DT compatible"), kernel warns as
follows since the spi_device_id is missing:

SPI driver sca3300 has no spi_device_id for murata,scl3300

Add spi_device_id entries to silence the warning, and ensure driver
module autoloading works.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Link: https://lore.kernel.org/r/20220921163620.805879-3-weiyongjun@huaweicloud.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Wei Yongjun and committed by
Jonathan Cameron
35dab731 4eb61e1a

+10 -2
+10 -2
drivers/iio/accel/sca3300.c
··· 679 679 }; 680 680 MODULE_DEVICE_TABLE(of, sca3300_dt_ids); 681 681 682 + static const struct spi_device_id sca3300_ids[] = { 683 + { "sca3300" }, 684 + { "scl3300" }, 685 + {} 686 + }; 687 + MODULE_DEVICE_TABLE(spi, sca3300_ids); 688 + 682 689 static struct spi_driver sca3300_driver = { 683 - .driver = { 690 + .driver = { 684 691 .name = SCA3300_ALIAS, 685 692 .of_match_table = sca3300_dt_ids, 686 693 }, 687 - .probe = sca3300_probe, 694 + .probe = sca3300_probe, 695 + .id_table = sca3300_ids, 688 696 }; 689 697 module_spi_driver(sca3300_driver); 690 698