git: de6353ad8fdf - main - gpiopower: Fix call to ofw_gpiobus_parse_gpios

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Wed, 27 Apr 2022 22:01:12 UTC
The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=de6353ad8fdf3783d19012fec7c1d69926a3f772

commit de6353ad8fdf3783d19012fec7c1d69926a3f772
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2022-04-27 21:55:28 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2022-04-27 22:00:32 +0000

    gpiopower: Fix call to ofw_gpiobus_parse_gpios
    
    Failure is denoted by -1, not non-zero.  A positive integer denotes the
    number of pins mapped and configured.
---
 sys/dev/gpio/gpiopower.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/gpio/gpiopower.c b/sys/dev/gpio/gpiopower.c
index 3dcd489ed2fb..3a87ba6597ce 100644
--- a/sys/dev/gpio/gpiopower.c
+++ b/sys/dev/gpio/gpiopower.c
@@ -74,7 +74,7 @@ gpiopower_attach(device_t dev)
 	if ((node = ofw_bus_get_node(dev)) == -1)
 		return (ENXIO);
 
-	if (ofw_gpiobus_parse_gpios(dev, "gpios", &sc->sc_pin) != 0) {
+	if (ofw_gpiobus_parse_gpios(dev, "gpios", &sc->sc_pin) <= 0) {
 		device_printf(dev, "failed to map GPIO pin\n");
 		return (ENXIO);
 	}