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 Do not crash if the optional vpcie3v3-...



details:   https://anonhg.NetBSD.org/src/rev/5893e0b30ee0
branches:  trunk
changeset: 1005092:5893e0b30ee0
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Nov 29 00:36:22 2019 +0000

description:
Do not crash if the optional vpcie3v3-supply property is missing or the
regulator can not be found.

diffstat:

 sys/arch/arm/rockchip/rk3399_pcie.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 0a3817c92536 -r 5893e0b30ee0 sys/arch/arm/rockchip/rk3399_pcie.c
--- a/sys/arch/arm/rockchip/rk3399_pcie.c       Thu Nov 28 23:57:09 2019 +0000
+++ b/sys/arch/arm/rockchip/rk3399_pcie.c       Fri Nov 29 00:36:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_pcie.c,v 1.6 2019/06/23 16:15:43 jmcneill Exp $ */
+/* $NetBSD: rk3399_pcie.c,v 1.7 2019/11/29 00:36:22 jmcneill Exp $ */
 /*
  * Copyright (c) 2018 Mark Kettenis <kettenis%openbsd.org@localhost>
  *
@@ -17,7 +17,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.6 2019/06/23 16:15:43 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.7 2019/11/29 00:36:22 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -241,8 +241,10 @@
 
        struct fdtbus_regulator *regulator;
        regulator = fdtbus_regulator_acquire(phandle, "vpcie3v3-supply");
-       fdtbus_regulator_enable(regulator);
-       fdtbus_regulator_release(regulator);
+       if (regulator != NULL) {
+               fdtbus_regulator_enable(regulator);
+               fdtbus_regulator_release(regulator);
+       }
                
        fdtbus_clock_assign(phandle);
        clock_enable_all(phandle);



Home | Main Index | Thread Index | Old Index