Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/dev Print error codes from sysmon
details: https://anonhg.NetBSD.org/src/rev/e26c6e37e3a3
branches: trunk
changeset: 337786:e26c6e37e3a3
user: martin <martin%NetBSD.org@localhost>
date: Mon Apr 27 11:55:29 2015 +0000
description:
Print error codes from sysmon
diffstat:
sys/arch/sparc64/dev/lom.c | 11 ++++++-----
sys/arch/sparc64/dev/tda.c | 24 ++++++++++++++----------
2 files changed, 20 insertions(+), 15 deletions(-)
diffs (104 lines):
diff -r 0a9975929c4f -r e26c6e37e3a3 sys/arch/sparc64/dev/lom.c
--- a/sys/arch/sparc64/dev/lom.c Mon Apr 27 10:37:20 2015 +0000
+++ b/sys/arch/sparc64/dev/lom.c Mon Apr 27 11:55:29 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lom.c,v 1.14 2015/02/21 07:40:01 nakayama Exp $ */
+/* $NetBSD: lom.c,v 1.15 2015/04/27 11:55:29 martin Exp $ */
/* $OpenBSD: lom.c,v 1.21 2010/02/28 20:44:39 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lom.c,v 1.14 2015/02/21 07:40:01 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lom.c,v 1.15 2015/04/27 11:55:29 martin Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -265,7 +265,7 @@
struct ebus_attach_args *ea = aux;
uint8_t reg, fw_rev, config, config2, config3;
uint8_t cal, low;
- int i;
+ int i, err;
const struct sysctlnode *node = NULL, *newnode;
if (strcmp(ea->ea_name, "SUNW,lomh") == 0) {
@@ -415,9 +415,10 @@
sc->sc_sme->sme_name = device_xname(self);
sc->sc_sme->sme_cookie = sc;
sc->sc_sme->sme_refresh = lom_refresh;
- if (sysmon_envsys_register(sc->sc_sme)) {
+ err = sysmon_envsys_register(sc->sc_sme);
+ if (err) {
aprint_error_dev(self,
- "unable to register envsys with sysmon\n");
+ "unable to register envsys with sysmon, error %d\n", err);
sysmon_envsys_destroy(sc->sc_sme);
return;
}
diff -r 0a9975929c4f -r e26c6e37e3a3 sys/arch/sparc64/dev/tda.c
--- a/sys/arch/sparc64/dev/tda.c Mon Apr 27 10:37:20 2015 +0000
+++ b/sys/arch/sparc64/dev/tda.c Mon Apr 27 11:55:29 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tda.c,v 1.9 2013/10/26 18:49:30 jdc Exp $ */
+/* $NetBSD: tda.c,v 1.10 2015/04/27 11:55:29 martin Exp $ */
/* $OpenBSD: tda.c,v 1.4 2008/02/27 17:25:00 robert Exp $ */
/*
@@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tda.c,v 1.9 2013/10/26 18:49:30 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tda.c,v 1.10 2015/04/27 11:55:29 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -108,6 +108,7 @@
{
struct tda_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
+ int rc;
sc->sc_dev = self;
sc->sc_tag = ia->ia_tag;
@@ -138,26 +139,29 @@
strlcpy(sc->sc_sensor[SENSOR_FAN_SYS].desc,
"fan.sys",sizeof("fan.sys"));
sc->sc_sme = sysmon_envsys_create();
- if (sysmon_envsys_sensor_attach(
- sc->sc_sme, &sc->sc_sensor[SENSOR_FAN_CPU])) {
+ rc = sysmon_envsys_sensor_attach(
+ sc->sc_sme, &sc->sc_sensor[SENSOR_FAN_CPU]);
+ if (rc) {
sysmon_envsys_destroy(sc->sc_sme);
aprint_error_dev(self,
- "unable to attach cpu fan at sysmon\n");
+ "unable to attach cpu fan at sysmon, error %d\n", rc);
return;
}
- if (sysmon_envsys_sensor_attach(
- sc->sc_sme, &sc->sc_sensor[SENSOR_FAN_SYS])) {
+ rc = sysmon_envsys_sensor_attach(
+ sc->sc_sme, &sc->sc_sensor[SENSOR_FAN_SYS]);
+ if (rc) {
sysmon_envsys_destroy(sc->sc_sme);
aprint_error_dev(self,
- "unable to attach sys fan at sysmon\n");
+ "unable to attach sys fan at sysmon, error %d\n", rc);
return;
}
sc->sc_sme->sme_name = device_xname(self);
sc->sc_sme->sme_cookie = sc;
sc->sc_sme->sme_refresh = tda_refresh;
- if (sysmon_envsys_register(sc->sc_sme)) {
+ rc = sysmon_envsys_register(sc->sc_sme);
+ if (rc) {
aprint_error_dev(self,
- "unable to register with sysmon\n");
+ "unable to register with sysmon, error %d\n", rc);
sysmon_envsys_destroy(sc->sc_sme);
return;
}
Home |
Main Index |
Thread Index |
Old Index