aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2022-04-27 21:55:28 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2022-04-27 22:00:32 +0000
commitde6353ad8fdf3783d19012fec7c1d69926a3f772 (patch)
tree92499119f7bbbebd9ad8acc9a7316a029accd448
parent00a80538b4471b2978c5a1990f48189f2c692e24 (diff)
downloadsrc-de6353ad8fdf3783d19012fec7c1d69926a3f772.tar.gz
src-de6353ad8fdf3783d19012fec7c1d69926a3f772.zip
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.
-rw-r--r--sys/dev/gpio/gpiopower.c2
1 files changed, 1 insertions, 1 deletions
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);
}