summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-25 00:27:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-25 00:27:10 +0000
commita4c3b7ec0287ed2c1f13db6adc27979043d7585d (patch)
tree466e8ff8c5cc6572b42c628ff60bb1e3e9d5e58e /sys/dev
parentd970db595ba904ec0ca4679a6df152363a4accd5 (diff)
put the serial number into the name of the devices (for sysctl), because
Joerg Goltermann has so many of them and has convinced me that he cannot tell them apart. ok grange cnst henning
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/onewire/owid.c4
-rw-r--r--sys/dev/onewire/owsbm.c4
-rw-r--r--sys/dev/onewire/owtemp.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/onewire/owid.c b/sys/dev/onewire/owid.c
index 2470f48b263..e2efab5b6d2 100644
--- a/sys/dev/onewire/owid.c
+++ b/sys/dev/onewire/owid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owid.c,v 1.5 2007/06/01 21:30:31 cnst Exp $ */
+/* $OpenBSD: owid.c,v 1.6 2008/10/25 00:27:09 deraadt Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -85,6 +85,8 @@ owid_attach(struct device *parent, struct device *self, void *aux)
sizeof(sc->sc_sensordev.xname));
sc->sc_sensor.type = SENSOR_INTEGER;
sc->sc_sensor.value = ONEWIRE_ROM_SN(sc->sc_rom);
+ snprintf(sc->sc_sensor.desc, sizeof(sc->sc_sensor.desc), "sn %012llx",
+ ONEWIRE_ROM_SN(oa->oa_rom));
sensor_attach(&sc->sc_sensordev, &sc->sc_sensor);
sensordev_install(&sc->sc_sensordev);
diff --git a/sys/dev/onewire/owsbm.c b/sys/dev/onewire/owsbm.c
index 3f6ef634f2a..3fb4faf54b4 100644
--- a/sys/dev/onewire/owsbm.c
+++ b/sys/dev/onewire/owsbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owsbm.c,v 1.4 2007/06/24 05:34:35 dlg Exp $ */
+/* $OpenBSD: owsbm.c,v 1.5 2008/10/25 00:27:09 deraadt Exp $ */
/*
* Copyright (c) 2007 Aaron Linville <aaron@linville.org>
@@ -117,6 +117,8 @@ owsbm_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
sizeof(sc->sc_sensordev.xname));
sc->sc_temp.type = SENSOR_TEMP;
+ snprintf(sc->sc_temp.desc, sizeof(sc->sc_temp.desc), "sn %012llx",
+ ONEWIRE_ROM_SN(oa->oa_rom));
sensor_attach(&sc->sc_sensordev, &sc->sc_temp);
/* Initialize voltage sensor */
diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c
index 38d990f59a9..204ed1e93f8 100644
--- a/sys/dev/onewire/owtemp.c
+++ b/sys/dev/onewire/owtemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owtemp.c,v 1.9 2007/11/28 18:26:11 todd Exp $ */
+/* $OpenBSD: owtemp.c,v 1.10 2008/10/25 00:27:09 deraadt Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -100,6 +100,8 @@ owtemp_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
sizeof(sc->sc_sensordev.xname));
sc->sc_sensor.type = SENSOR_TEMP;
+ snprintf(sc->sc_sensor.desc, sizeof(sc->sc_sensor.desc), "sn %012llx",
+ ONEWIRE_ROM_SN(oa->oa_rom));
sc->sc_sensortask = sensor_task_register(sc, owtemp_update, 5);
if (sc->sc_sensortask == NULL) {