summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormaya <maya@NetBSD.org>2017-01-20 12:25:07 +0000
committermaya <maya@NetBSD.org>2017-01-20 12:25:07 +0000
commit85e09bc412b29793fc70dfdaf584fbf205f27a8b (patch)
tree3c0465de6d963e2b07f863e61da09c4eaa7f58e2 /sys/dev
parent7b70ea82202f488e212768863d3d104a9a8e6733 (diff)
Check pmf_device_register return value. NFC
Appeases static analyzers.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/drm/vbox_drv.c7
-rw-r--r--sys/dev/gpio/gpiolock.c5
-rw-r--r--sys/dev/gpio/gpiopwm.c5
-rw-r--r--sys/dev/gpio/gpiosim.c5
-rw-r--r--sys/dev/pci/gffb.c8
-rw-r--r--sys/dev/pci/ibmcd.c5
-rw-r--r--sys/dev/pci/pwdog.c5
-rw-r--r--sys/dev/pci/r128fb.c8
-rw-r--r--sys/dev/podulebus/sec.c8
-rw-r--r--sys/dev/usb/irmce.c7
10 files changed, 38 insertions, 25 deletions
diff --git a/sys/dev/drm/vbox_drv.c b/sys/dev/drm/vbox_drv.c
index f16eee6fb5b..e72025a49c7 100644
--- a/sys/dev/drm/vbox_drv.c
+++ b/sys/dev/drm/vbox_drv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vbox_drv.c,v 1.2 2011/08/28 17:18:31 jmcneill Exp $ */
+/* $NetBSD: vbox_drv.c,v 1.3 2017/01/20 12:25:07 maya Exp $ */
/*
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vbox_drv.c,v 1.2 2011/08/28 17:18:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vbox_drv.c,v 1.3 2017/01/20 12:25:07 maya Exp $");
#include "drmP.h"
#include "drm.h"
@@ -69,7 +69,8 @@ vboxdrm_attach(device_t parent, device_t self, void *opaque)
struct pci_attach_args *pa = opaque;
struct drm_device *dev = device_private(self);
- pmf_device_register(self, NULL, NULL);
+ if (!pmf_device_register(self, NULL, NULL))
+ aprint_error_dev(self, "couldn't establish power handler\n");
dev->driver = kmem_zalloc(sizeof(struct drm_driver_info), KM_SLEEP);
if (dev->driver == NULL) {
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,
diff --git a/sys/dev/pci/gffb.c b/sys/dev/pci/gffb.c
index 004e7f26fe1..30d2b48f9d7 100644
--- a/sys/dev/pci/gffb.c
+++ b/sys/dev/pci/gffb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gffb.c,v 1.11 2016/07/11 11:31:51 msaitoh Exp $ */
+/* $NetBSD: gffb.c,v 1.12 2017/01/20 12:25:07 maya Exp $ */
/*
* Copyright (c) 2013 Michael Lorenz
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gffb.c,v 1.11 2016/07/11 11:31:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gffb.c,v 1.12 2017/01/20 12:25:07 maya Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -342,7 +342,9 @@ gffb_attach(device_t parent, device_t self, void *aux)
}
/* no suspend/resume support yet */
- pmf_device_register(sc->sc_dev, NULL, NULL);
+ if (!pmf_device_register(sc->sc_dev, NULL, NULL))
+ aprint_error_dev(sc->sc_dev,
+ "couldn't establish power handler\n");
aa.console = is_console;
aa.scrdata = &sc->sc_screenlist;
diff --git a/sys/dev/pci/ibmcd.c b/sys/dev/pci/ibmcd.c
index a6052328f2b..3788432c9f0 100644
--- a/sys/dev/pci/ibmcd.c
+++ b/sys/dev/pci/ibmcd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ibmcd.c,v 1.2 2016/07/14 10:19:06 msaitoh Exp $ */
+/* $NetBSD: ibmcd.c,v 1.3 2017/01/20 12:25:07 maya Exp $ */
/*
* Copyright (c) 2012 Marc Balmer <marc@msys.ch>
@@ -114,7 +114,8 @@ ibmcd_attach(device_t parent, device_t self, void *aux)
aprint_normal(": IBM 4810 BSP cash drawer\n");
#if (__NetBSD_Version__ >= 600000000)
- pmf_device_register(self, ibmcd_suspend, ibmcd_resume);
+ if (!pmf_device_register(self, ibmcd_suspend, ibmcd_resume))
+ aprint_error_dev(self, "couldn't establish power handler\n");
#endif
/* Initialize pins array */
sc->sc_gpio_pins[PIN_OPEN].pin_num = 0;
diff --git a/sys/dev/pci/pwdog.c b/sys/dev/pci/pwdog.c
index b51e57d9395..c67c22daa4f 100644
--- a/sys/dev/pci/pwdog.c
+++ b/sys/dev/pci/pwdog.c
@@ -1,4 +1,4 @@
-/* $$NetBSD: pwdog.c,v 1.9 2016/07/14 10:19:06 msaitoh Exp $ */
+/* $$NetBSD: pwdog.c,v 1.10 2017/01/20 12:25:07 maya Exp $ */
/* $OpenBSD: pwdog.c,v 1.7 2010/04/08 00:23:53 tedu Exp $ */
/*
@@ -96,7 +96,8 @@ pwdog_attach(device_t parent, device_t self, void *aux)
sc->sc_dev = self;
- pmf_device_register(self, pwdog_suspend, pwdog_resume);
+ if (!pmf_device_register(self, pwdog_suspend, pwdog_resume))
+ aprint_error_dev(self, "couldn't establish power handler\n");
bus_space_write_1(sc->sc_iot, sc->sc_ioh, PWDOG_DISABLE, 0);
sc->sc_smw.smw_name = device_xname(self);
diff --git a/sys/dev/pci/r128fb.c b/sys/dev/pci/r128fb.c
index 6dec678f55d..09fac6b503c 100644
--- a/sys/dev/pci/r128fb.c
+++ b/sys/dev/pci/r128fb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: r128fb.c,v 1.39 2015/09/16 16:52:54 macallan Exp $ */
+/* $NetBSD: r128fb.c,v 1.40 2017/01/20 12:25:07 maya Exp $ */
/*
* Copyright (c) 2007, 2012 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.39 2015/09/16 16:52:54 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.40 2017/01/20 12:25:07 maya Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -332,7 +332,9 @@ r128fb_attach(device_t parent, device_t self, void *aux)
}
/* no suspend/resume support yet */
- pmf_device_register(sc->sc_dev, NULL, NULL);
+ if (!pmf_device_register(sc->sc_dev, NULL, NULL))
+ aprint_error_dev(sc->sc_dev,
+ "couldn't establish power handler\n");
reg = bus_space_read_4(sc->sc_memt, sc->sc_regh, R128_LVDS_GEN_CNTL);
DPRINTF("R128_LVDS_GEN_CNTL: %08x\n", reg);
diff --git a/sys/dev/podulebus/sec.c b/sys/dev/podulebus/sec.c
index 32244e3f65c..ec084bf21b7 100644
--- a/sys/dev/podulebus/sec.c
+++ b/sys/dev/podulebus/sec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sec.c,v 1.16 2014/01/21 19:50:16 christos Exp $ */
+/* $NetBSD: sec.c,v 1.17 2017/01/20 12:25:07 maya Exp $ */
/*-
* Copyright (c) 2000, 2001, 2006 Ben Harris
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sec.c,v 1.16 2014/01/21 19:50:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sec.c,v 1.17 2017/01/20 12:25:07 maya Exp $");
#include <sys/param.h>
@@ -214,7 +214,9 @@ sec_attach(device_t parent, device_t self, void *aux)
sec_cli(sc);
sc->sc_mpr |= SEC_MPR_IE;
bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_MPR, sc->sc_mpr);
- pmf_device_register1(sc->sc_sbic.sc_dev, NULL, NULL, sec_shutdown);
+ if (!pmf_device_register1(sc->sc_sbic.sc_dev, NULL, NULL, sec_shutdown))
+ aprint_error_dev(sc->sc_sbic.sc_dev,
+ "couldn't establish power handler\n");
}
/*
diff --git a/sys/dev/usb/irmce.c b/sys/dev/usb/irmce.c
index b250ac20383..9fcb104c674 100644
--- a/sys/dev/usb/irmce.c
+++ b/sys/dev/usb/irmce.c
@@ -1,4 +1,4 @@
-/* $NetBSD: irmce.c,v 1.2 2016/04/23 10:15:32 skrll Exp $ */
+/* $NetBSD: irmce.c,v 1.3 2017/01/20 12:25:07 maya Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irmce.c,v 1.2 2016/04/23 10:15:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irmce.c,v 1.3 2017/01/20 12:25:07 maya Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -150,7 +150,8 @@ irmce_attach(device_t parent, device_t self, void *opaque)
unsigned int i;
uint8_t nep;
- pmf_device_register(self, NULL, NULL);
+ if (!pmf_device_register(self, NULL, NULL))
+ aprint_error_dev(self, "couldn't establish power handler\n");
aprint_naive("\n");