[PATCH v2 5/6] iio: pressure: dps310: add an OF match table
From: Paulius Zaleckas
Date: Tue Oct 13 2026 - 07:27:57 EST
Devicetree nodes match the driver only through the I2C ID table fallback.
Add an OF match table, so the chip data comes from the compatible and the
module autoloads from the of: modalias the I2C core reports for
devicetree devices.
Assisted-by: LLM
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@xxxxxxxxx>
---
drivers/iio/pressure/dps310.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
index 0d558edff5ab..3b27a61b70a5 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -1045,6 +1045,12 @@ static const struct i2c_device_id dps310_id[] = {
};
MODULE_DEVICE_TABLE(i2c, dps310_id);
+static const struct of_device_id dps310_of_match[] = {
+ { .compatible = "infineon,dps310", .data = &dps310_chip_info },
+ { }
+};
+MODULE_DEVICE_TABLE(of, dps310_of_match);
+
static const struct acpi_device_id dps310_acpi_match[] = {
{ "IFX3100", (kernel_ulong_t)&dps310_chip_info },
{ }
@@ -1054,6 +1060,7 @@ MODULE_DEVICE_TABLE(acpi, dps310_acpi_match);
static struct i2c_driver dps310_driver = {
.driver = {
.name = DPS310_DEV_NAME,
+ .of_match_table = dps310_of_match,
.acpi_match_table = dps310_acpi_match,
},
.probe = dps310_probe,
--
2.55.0