[v1,30/43] rtc: m48t86: add DT support for m48t86
Commit Message
- get regs from device tree
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
Notes:
v0 -> v1:
- dropped CONFIG_OF, of_match_ptr
- dropped coma in id table
- changed compatible from "dallas,rtc-m48t86" to "st,m48t86"
drivers/rtc/rtc-m48t86.c | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On Thu, Jun 1, 2023 at 7:46 AM Nikita Shubin <nikita.shubin@maquefel.me> wrote:
> - get regs from device tree
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
Thu, Jun 01, 2023 at 08:45:35AM +0300, Nikita Shubin kirjoitti:
> - get regs from device tree
...
> +#include <linux/of.h>
This is wrong header. Should be mod_devicetable.h.
Please, as I mentioned before, change this in *all* patches in your series
where just an ID table is added.
@@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/bcd.h>
#include <linux/io.h>
+#include <linux/of.h>
#define M48T86_SEC 0x00
#define M48T86_SECALRM 0x01
@@ -269,9 +270,16 @@ static int m48t86_rtc_probe(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id m48t86_rtc_of_ids[] = {
+ { .compatible = "st,m48t86" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, m48t86_rtc_of_ids);
+
static struct platform_driver m48t86_rtc_platform_driver = {
.driver = {
.name = "rtc-m48t86",
+ .of_match_table = m48t86_rtc_of_ids,
},
.probe = m48t86_rtc_probe,
};