Module Name:    src
Committed By:   jmcneill
Date:           Fri Nov 29 00:36:22 UTC 2019

Modified Files:
        src/sys/arch/arm/rockchip: rk3399_pcie.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/rockchip/rk3399_pcie.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/rockchip/rk3399_pcie.c
diff -u src/sys/arch/arm/rockchip/rk3399_pcie.c:1.6 src/sys/arch/arm/rockchip/rk3399_pcie.c:1.7
--- src/sys/arch/arm/rockchip/rk3399_pcie.c:1.6	Sun Jun 23 16:15:43 2019
+++ src/sys/arch/arm/rockchip/rk3399_pcie.c	Fri Nov 29 00:36:22 2019
@@ -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 <kette...@openbsd.org>
  *
@@ -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 @@ rkpcie_attach(device_t parent, device_t 
 
 	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);

Reply via email to