rkpwm(4) device tree bindings were updated to not have clock names anymore,
authorpatrick <patrick@openbsd.org>
Mon, 2 Aug 2021 18:22:41 +0000 (18:22 +0000)
committerpatrick <patrick@openbsd.org>
Mon, 2 Aug 2021 18:22:41 +0000 (18:22 +0000)
so simply look up the first clock instead of looking for a specific one by
name.  Allows rkpwm(4) to find the clock when using a recent device tree.

From Tomasz Bielecki
ok kettenis@

sys/dev/fdt/rkpwm.c

index 1a8548d..f95edea 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rkpwm.c,v 1.2 2020/09/08 01:29:04 jmatthew Exp $      */
+/*     $OpenBSD: rkpwm.c,v 1.3 2021/08/02 18:22:41 patrick Exp $       */
 /*
  * Copyright (c) 2019 Krystian Lewandowski
  * Copyright (c) 2019 Patrick Wildt <patrick@blueri.se>
@@ -93,7 +93,7 @@ rkpwm_attach(struct device *parent, struct device *self, void *aux)
                return;
        }
 
-       sc->sc_clkin = clock_get_frequency(faa->fa_node, "pwm");
+       sc->sc_clkin = clock_get_frequency(faa->fa_node, NULL);
        if (sc->sc_clkin == 0) {
                printf(": no clock\n");
                return;