summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-04-27 12:41:45 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-04-27 12:41:45 +0000
commit35b859290253761169bd78e67b9b5e02471263af (patch)
treef2e6c1ea3d3d8ed278a9897526eff09fe4d4c456 /sys/dev
parent1e6d54d54710577de6ab12305e34ad89cafce940 (diff)
Attach when the name matches "dallas,ds1307" which is what the device tree
binding uses. Remove warning about overwriting todr_handle since that is normal behaviour on arm64 systems. ok sthen@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/i2c/ds1307.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/i2c/ds1307.c b/sys/dev/i2c/ds1307.c
index e5cbf1c9d4e..be831d62a18 100644
--- a/sys/dev/i2c/ds1307.c
+++ b/sys/dev/i2c/ds1307.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ds1307.c,v 1.1 2016/06/20 13:42:42 mglocker Exp $ */
+/* $OpenBSD: ds1307.c,v 1.2 2020/04/27 12:41:44 kettenis Exp $ */
/*
* Copyright (c) 2016 Marcus Glocker <mglocker@openbsd.org>
@@ -96,7 +96,8 @@ maxrtc_match(struct device *parent, void *v, void *arg)
{
struct i2c_attach_args *ia = arg;
- if (strcmp(ia->ia_name, "ds1307") == 0)
+ if (strcmp(ia->ia_name, "dallas,ds1307") == 0 ||
+ strcmp(ia->ia_name, "ds1307") == 0)
return (1);
return (0);
@@ -123,12 +124,6 @@ maxrtc_attach(struct device *parent, struct device *self, void *arg)
if (maxrtc_set_24h_mode(sc) == -1)
return;
- /* register our time handlers */
- if (todr_handle != NULL) {
- printf("%s: overwriting existing rtc handler\n",
- sc->sc_dev.dv_xname);
- }
- /* XXX just overwrite existing rtc handler? */
todr_handle = &sc->sc_todr;
}