diff --git a/sys/arch/arm/rockchip/rk_i2s.c b/sys/arch/arm/rockchip/rk_i2s.c index 88a388f3d0a9..96ca0a8da530 100644 --- a/sys/arch/arm/rockchip/rk_i2s.c +++ b/sys/arch/arm/rockchip/rk_i2s.c @@ -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 @@ -27,7 +27,7 @@ */ #include -__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 #include @@ -587,8 +587,12 @@ rk_i2s_attach(device_t parent, device_t self, void *aux) 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);