Module Name:    src
Committed By:   cnst
Date:           Tue Feb  9 03:26:45 UTC 2010

Modified Files:
        src/sys/dev/acpi: atk0110.c

Log Message:
use ACPI_INTEGER and PRIx64, and check success of sensor_attach;    suggested 
by jruoho (Jukka Ruohonen)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/atk0110.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/atk0110.c
diff -u src/sys/dev/acpi/atk0110.c:1.1 src/sys/dev/acpi/atk0110.c:1.2
--- src/sys/dev/acpi/atk0110.c:1.1	Tue Feb  9 03:19:51 2010
+++ src/sys/dev/acpi/atk0110.c	Tue Feb  9 03:26:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: atk0110.c,v 1.1 2010/02/09 03:19:51 cnst Exp $	*/
+/*	$NetBSD: atk0110.c,v 1.2 2010/02/09 03:26:44 cnst Exp $	*/
 /*	$OpenBSD: atk0110.c,v 1.1 2009/07/23 01:38:16 cnst Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.1 2010/02/09 03:19:51 cnst Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.2 2010/02/09 03:26:44 cnst Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,9 +47,9 @@
 
 struct aibs_sensor {
 	envsys_data_t	s;
-	int64_t		i;
-	int64_t		l;
-	int64_t		h;
+	ACPI_INTEGER	i;
+	ACPI_INTEGER	l;
+	ACPI_INTEGER	h;
 };
 
 struct aibs_softc {
@@ -252,11 +252,14 @@
 		as[i].s.monitor = true;
 #endif
 		aprint_verbose_dev(self, "%c%i: "
-		    "0x%08llx %20s %5lli / %5lli  0x%llx\n",
+		    "0x%08"PRIx64" %20s %5"PRIi64" / %5"PRIi64"  "
+		    "0x%"PRIx64"\n",
 		    name[0], i,
-		    as[i].i, as[i].s.desc, as[i].l, as[i].h,
+		    as[i].i, as[i].s.desc, (int64_t)as[i].l, (int64_t)as[i].h,
 		    oi[4].Integer.Value);
-		sysmon_envsys_sensor_attach(sc->sc_sme, &as[i].s);
+		if (sysmon_envsys_sensor_attach(sc->sc_sme, &as[i].s))
+			aprint_error_dev(self, "%c%i: unable to attach\n",
+			    name[0], i);
 	}
 
 	AcpiOsFree(b.Pointer);
@@ -292,8 +295,8 @@
 	int			i;
 	const char		*name;
 	struct aibs_sensor	*as;
-	int64_t			v;
-	int64_t			l, h;
+	ACPI_INTEGER		v;
+	ACPI_INTEGER		l, h;
 
 	switch (st) {
 	case ENVSYS_STEMP:
@@ -398,7 +401,7 @@
 	enum envsys_units	st = s->units;
 	int			i;
 	struct aibs_sensor	*as;
-	int64_t			l, h;
+	ACPI_INTEGER		l, h;
 
 	switch (st) {
 	case ENVSYS_STEMP:

Reply via email to