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/2378354f0fbe
branches:  trunk
changeset: 967722:2378354f0fbe
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 6fe31f6d165d -r 2378354f0fbe 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