Date: Wed, 27 Apr 2022 22:01:12 GMT From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: de6353ad8fdf - main - gpiopower: Fix call to ofw_gpiobus_parse_gpios Message-ID: <202204272201.23RM1CvA060840@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204272201.23RM1CvA060840>