From: Jun Yan <jerrysteve1101@gmail.com>
To: jic23@kernel.org
Cc: lars@metafoo.de, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, Jun Yan <jerrysteve1101@gmail.com>
Subject: [PATCH v3] iio: gyro: bmg160_spi: add of_match_table
Date: Thu, 6 Mar 2025 22:57:40 +0800 [thread overview]
Message-ID: <20250306145740.32687-1-jerrysteve1101@gmail.com> (raw)
Add the missing of_match_table to bmg160_spi
driver to enhance device tree compatibility.
Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
---
Changes in v3
- Adjust the content of the commit message; there are no code changes.
- Link to v2: https://lore.kernel.org/linux-iio/20250220165001.273325-1-jerrysteve1101@gmail.com/
Changes in v2
- Fix a syntax error (a missing comma after the .of_match_table = bmg160_of_match).
- Fix the style issues found by checkpatch.pl.
- Link to v1: https://lore.kernel.org/linux-iio/20250219150254.24664-1-jerrysteve1101@gmail.com/
---
drivers/iio/gyro/bmg160_spi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c
index fc2e453527b9..ac04b3b1b554 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,
--
2.48.1
next reply other threads:[~2025-03-06 14:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 14:57 Jun Yan [this message]
2025-03-07 3:46 ` Marcelo Schmitt
2025-03-08 14:34 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250306145740.32687-1-jerrysteve1101@gmail.com \
--to=jerrysteve1101@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®