From: Jun Yan Date: Thu, 6 Mar 2025 14:57:40 +0000 (+0800) Subject: iio: gyro: bmg160_spi: add of_match_table X-Git-Tag: v6.15-rc1~78^2~8^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85a1159e4c0eba614b17cddb929f871de3a8bff5;p=thirdparty%2Fkernel%2Flinux.git iio: gyro: bmg160_spi: add of_match_table Add the missing of_match_table to bmg160_spi driver to enhance devicetree compatibility. Signed-off-by: Jun Yan Reviewed-by: Marcelo Schmitt Link: https://patch.msgid.link/20250306145740.32687-1-jerrysteve1101@gmail.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c index fc2e453527b97..ac04b3b1b554a 100644 --- a/drivers/iio/gyro/bmg160_spi.c +++ b/drivers/iio/gyro/bmg160_spi.c @@ -41,9 +41,19 @@ static const struct spi_device_id bmg160_spi_id[] = { MODULE_DEVICE_TABLE(spi, bmg160_spi_id); +static const struct of_device_id bmg160_of_match[] = { + { .compatible = "bosch,bmg160" }, + { .compatible = "bosch,bmi055_gyro" }, + { .compatible = "bosch,bmi088_gyro" }, + { } +}; + +MODULE_DEVICE_TABLE(of, bmg160_of_match); + static struct spi_driver bmg160_spi_driver = { .driver = { .name = "bmg160_spi", + .of_match_table = bmg160_of_match, .pm = &bmg160_pm_ops, }, .probe = bmg160_spi_probe,