]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtc: m41t93: add device tree support
authorAkhilesh Patil <akhilesh@ee.iitb.ac.in>
Sat, 20 Sep 2025 15:01:47 +0000 (20:31 +0530)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 24 Jun 2026 20:55:02 +0000 (22:55 +0200)
Add device tree support for m41t93 rtc by adding of_match_table.
Define compatible string - "st,m41t93" which can be used to instantiate
this rtc device via DT node.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Link: https://patch.msgid.link/060ef5c5adaa444d2c623aa8ce4c540fa19d0f95.1758379856.git.akhilesh@ee.iitb.ac.in
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-m41t93.c

index 9444cb5f5190e92876e3f44c05799274f8a28854..4e803ff0ce491fb39de5642b699fc70faa5df505 100644 (file)
@@ -191,9 +191,16 @@ static int m41t93_probe(struct spi_device *spi)
        return 0;
 }
 
+static const struct of_device_id m41t93_dt_match[] = {
+       { .compatible = "st,m41t93" },
+       { }
+};
+MODULE_DEVICE_TABLE(of, m41t93_dt_match);
+
 static struct spi_driver m41t93_driver = {
        .driver = {
                .name   = "rtc-m41t93",
+               .of_match_table = m41t93_dt_match,
        },
        .probe  = m41t93_probe,
 };