diff options
| author | maya <maya@NetBSD.org> | 2017-01-20 12:25:07 +0000 |
|---|---|---|
| committer | maya <maya@NetBSD.org> | 2017-01-20 12:25:07 +0000 |
| commit | 85e09bc412b29793fc70dfdaf584fbf205f27a8b (patch) | |
| tree | 3c0465de6d963e2b07f863e61da09c4eaa7f58e2 /sys/dev/gpio | |
| parent | 7b70ea82202f488e212768863d3d104a9a8e6733 (diff) | |
Check pmf_device_register return value. NFC
Appeases static analyzers.
Diffstat (limited to 'sys/dev/gpio')
| -rw-r--r-- | sys/dev/gpio/gpiolock.c | 5 | ||||
| -rw-r--r-- | sys/dev/gpio/gpiopwm.c | 5 | ||||
| -rw-r--r-- | sys/dev/gpio/gpiosim.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/gpio/gpiolock.c b/sys/dev/gpio/gpiolock.c index 3b5702aa22e..94d17714e4f 100644 --- a/sys/dev/gpio/gpiolock.c +++ b/sys/dev/gpio/gpiolock.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpiolock.c,v 1.3 2009/12/06 22:33:44 dyoung Exp $ */ +/* $NetBSD: gpiolock.c,v 1.4 2017/01/20 12:25:07 maya Exp $ */ /* * Copyright (c) 2009 Marc Balmer <marc@msys.ch> @@ -123,7 +123,8 @@ gpiolock_attach(device_t parent, device_t self, void *aux) goto fail; } #endif - pmf_device_register(self, NULL, NULL); + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish power handler\n"); aprint_normal("\n"); return; diff --git a/sys/dev/gpio/gpiopwm.c b/sys/dev/gpio/gpiopwm.c index e35ee01d0fb..d9b9c7c7e0f 100644 --- a/sys/dev/gpio/gpiopwm.c +++ b/sys/dev/gpio/gpiopwm.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpiopwm.c,v 1.5 2016/07/14 04:00:45 msaitoh Exp $ */ +/* $NetBSD: gpiopwm.c,v 1.6 2017/01/20 12:25:07 maya Exp $ */ /* * Copyright (c) 2011 Marc Balmer <marc@msys.ch> @@ -104,7 +104,8 @@ gpiopwm_attach(device_t parent, device_t self, void *aux) return; } aprint_normal(" [%d]", sc->sc_map.pm_map[0]); - pmf_device_register(self, NULL, NULL); + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish power handler\n"); callout_init(&sc->sc_pulse, CALLOUT_MPSAFE); callout_setfunc(&sc->sc_pulse, gpiopwm_pulse, sc); diff --git a/sys/dev/gpio/gpiosim.c b/sys/dev/gpio/gpiosim.c index f79bcc4a45f..643fb1f5f96 100644 --- a/sys/dev/gpio/gpiosim.c +++ b/sys/dev/gpio/gpiosim.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpiosim.c,v 1.19 2016/07/14 04:00:45 msaitoh Exp $ */ +/* $NetBSD: gpiosim.c,v 1.20 2017/01/20 12:25:07 maya Exp $ */ /* $OpenBSD: gpiosim.c,v 1.1 2008/11/23 18:46:49 mbalmer Exp $ */ /* @@ -121,7 +121,8 @@ gpiosim_attach(device_t parent, device_t self, void *aux) gba.gba_pins = sc->sc_gpio_pins; gba.gba_npins = GPIOSIM_NPINS; - pmf_device_register(self, NULL, NULL); + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish power handler\n"); sysctl_createv(&sc->sc_log, 0, NULL, &node, 0, |
