Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/rockchip rk_i2s.c



details:   https://anonhg.NetBSD.org/src/rev/75112c4a051d
branches:  trunk
changeset: 979559:75112c4a051d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Jan 01 11:44:41 2021 +0000

description:
rk_i2s.c

diffstat:

 sys/arch/arm/rockchip/rk_i2s.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 3b96d1964378 -r 75112c4a051d sys/arch/arm/rockchip/rk_i2s.c
--- a/sys/arch/arm/rockchip/rk_i2s.c    Fri Jan 01 11:41:01 2021 +0000
+++ b/sys/arch/arm/rockchip/rk_i2s.c    Fri Jan 01 11:44:41 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_i2s.c,v 1.5 2020/12/31 20:47:06 mrg Exp $ */
+/* $NetBSD: rk_i2s.c,v 1.6 2021/01/01 11:44:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_i2s.c,v 1.5 2020/12/31 20:47:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_i2s.c,v 1.6 2021/01/01 11:44:41 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -587,8 +587,12 @@
        mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
 
        sc->sc_conf = (void *)of_search_compatible(phandle, compat_data)->data;
-       sc->sc_grf = fdtbus_syscon_acquire(phandle, "rockchip,grf");
-       if (sc->sc_grf != NULL && sc->sc_conf->oe_mask != 0) {
+       if (sc->sc_conf != NULL && sc->sc_conf->oe_mask != 0) {
+               sc->sc_grf = fdtbus_syscon_acquire(phandle, "rockchip,grf");
+               if (sc->sc_grf == NULL) {
+                       aprint_error(": couldn't find grf\n");
+                       return;
+               }
                syscon_lock(sc->sc_grf);
                val = __SHIFTIN(sc->sc_conf->oe_val, sc->sc_conf->oe_mask);
                val |= (sc->sc_conf->oe_mask << 16);



Home | Main Index | Thread Index | Old Index