Skip to content

Commit 85a1159

Browse files
yjun123jic23
authored andcommitted
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 <[email protected]> Reviewed-by: Marcelo Schmitt <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 352f4a6 commit 85a1159

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/iio/gyro/bmg160_spi.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,19 @@ static const struct spi_device_id bmg160_spi_id[] = {
4141

4242
MODULE_DEVICE_TABLE(spi, bmg160_spi_id);
4343

44+
static const struct of_device_id bmg160_of_match[] = {
45+
{ .compatible = "bosch,bmg160" },
46+
{ .compatible = "bosch,bmi055_gyro" },
47+
{ .compatible = "bosch,bmi088_gyro" },
48+
{ }
49+
};
50+
51+
MODULE_DEVICE_TABLE(of, bmg160_of_match);
52+
4453
static struct spi_driver bmg160_spi_driver = {
4554
.driver = {
4655
.name = "bmg160_spi",
56+
.of_match_table = bmg160_of_match,
4757
.pm = &bmg160_pm_ops,
4858
},
4959
.probe = bmg160_spi_probe,

0 commit comments

Comments
 (0)