Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt Abort panel driver attach if required regulator ...



details:   https://anonhg.NetBSD.org/src/rev/3eff37b9002e
branches:  trunk
changeset: 847356:3eff37b9002e
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Thu Dec 19 16:00:52 2019 +0000

description:
Abort panel driver attach if required regulator is missing.

diffstat:

 sys/dev/fdt/fdt_panel.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 610dca0c4e46 -r 3eff37b9002e sys/dev/fdt/fdt_panel.c
--- a/sys/dev/fdt/fdt_panel.c   Thu Dec 19 15:57:46 2019 +0000
+++ b/sys/dev/fdt/fdt_panel.c   Thu Dec 19 16:00:52 2019 +0000
@@ -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 <jakllsch%kollasch.net@localhost>
@@ -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 @@
 
        /* 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,



Home | Main Index | Thread Index | Old Index