Module Name:    src
Committed By:   jakllsch
Date:           Thu Dec 19 16:00:52 UTC 2019

Modified Files:
        src/sys/dev/fdt: fdt_panel.c

Log Message:
Abort panel driver attach if required regulator is missing.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fdt_panel.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/dev/fdt/fdt_panel.c
diff -u src/sys/dev/fdt/fdt_panel.c:1.1 src/sys/dev/fdt/fdt_panel.c:1.2
--- src/sys/dev/fdt/fdt_panel.c:1.1	Thu Dec 19 00:35:01 2019
+++ src/sys/dev/fdt/fdt_panel.c	Thu Dec 19 16:00:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_panel.c,v 1.1 2019/12/19 00:35:01 jakllsch Exp $ */
+/* $NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2019 Jonathan A. Kollasch <jakll...@kollasch.net>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.1 2019/12/19 00:35:01 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -144,6 +144,10 @@ panel_fdt_attach(device_t parent, device
 
 	/* required for "simple-panel" */
         sc->sc_regulator = fdtbus_regulator_acquire(phandle, "power-supply");
+        if (sc->sc_regulator == NULL) {
+		aprint_error_dev(self, "regulator not found\n");
+		return;
+	}
 
 	/* optional for "simple-panel" */
 	sc->sc_enable = fdtbus_gpio_acquire_index(phandle,

Reply via email to