Fri Dec 17 13:37:38 2010 UTC ()
use aprint


(pooka)
diff -r1.6 -r1.7 src/sys/dev/sysmon/swsensor.c

cvs diff -r1.6 -r1.7 src/sys/dev/sysmon/swsensor.c (expand / switch to unified diff)

--- src/sys/dev/sysmon/swsensor.c 2010/12/16 14:33:30 1.6
+++ src/sys/dev/sysmon/swsensor.c 2010/12/17 13:37:37 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: swsensor.c,v 1.6 2010/12/16 14:33:30 pgoyette Exp $ */ 1/* $NetBSD: swsensor.c,v 1.7 2010/12/17 13:37:37 pooka Exp $ */
2/* 2/*
3 * Copyright (c) 2008 The NetBSD Foundation, Inc. 3 * Copyright (c) 2008 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 17 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY 19 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: swsensor.c,v 1.6 2010/12/16 14:33:30 pgoyette Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: swsensor.c,v 1.7 2010/12/17 13:37:37 pooka Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/kernel.h> 33#include <sys/kernel.h>
34#include <sys/module.h> 34#include <sys/module.h>
35#include <sys/sysctl.h> 35#include <sys/sysctl.h>
36 36
37#include <dev/sysmon/sysmonvar.h> 37#include <dev/sysmon/sysmonvar.h>
38 38
39#include <prop/proplib.h> 39#include <prop/proplib.h>
40 40
41#ifndef _MODULE 41#ifndef _MODULE
42#include "opt_modular.h" 42#include "opt_modular.h"
43#endif 43#endif
@@ -233,37 +233,37 @@ swsensor_init(void *arg) @@ -233,37 +233,37 @@ swsensor_init(void *arg)
233 233
234 if (po != NULL && prop_object_type(po) == PROP_TYPE_NUMBER) 234 if (po != NULL && prop_object_type(po) == PROP_TYPE_NUMBER)
235 sw_sensor_value = prop_number_integer_value(po); 235 sw_sensor_value = prop_number_integer_value(po);
236 236
237 swsensor_edata.value_cur = 0; 237 swsensor_edata.value_cur = 0;
238 238
239 strlcpy(swsensor_edata.desc, "sensor", ENVSYS_DESCLEN); 239 strlcpy(swsensor_edata.desc, "sensor", ENVSYS_DESCLEN);
240 240
241 error = sysmon_envsys_sensor_attach(swsensor_sme, &swsensor_edata); 241 error = sysmon_envsys_sensor_attach(swsensor_sme, &swsensor_edata);
242 242
243 if (error == 0) 243 if (error == 0)
244 error = sysmon_envsys_register(swsensor_sme); 244 error = sysmon_envsys_register(swsensor_sme);
245 else { 245 else {
246 printf("sysmon_envsys_sensor_attach failed: %d\n", error); 246 aprint_error("sysmon_envsys_sensor_attach failed: %d\n", error);
247 return error; 247 return error;
248 } 248 }
249 249
250 if (error == 0) 250 if (error == 0)
251 sysctl_swsensor_setup(); 251 sysctl_swsensor_setup();
252 else 252 else
253 printf("sysmon_envsys_register failed: %d\n", error); 253 aprint_error("sysmon_envsys_register failed: %d\n", error);
254 254
255 if (error == 0) 255 if (error == 0)
256 printf("swsensor: initialized\n"); 256 aprint_normal("swsensor: initialized\n");
257 return error; 257 return error;
258} 258}
259 259
260static 260static
261int 261int
262swsensor_fini(void *arg) 262swsensor_fini(void *arg)
263{ 263{
264 264
265 sysmon_envsys_unregister(swsensor_sme); 265 sysmon_envsys_unregister(swsensor_sme);
266 266
267 sysctl_teardown(&swsensor_sysctllog); 267 sysctl_teardown(&swsensor_sysctllog);
268 268
269 return 0; 269 return 0;