From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:34:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63F8E106566C; Sun, 19 Aug 2012 19:34:11 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3441E8FC08; Sun, 19 Aug 2012 19:34:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJYBrD026374; Sun, 19 Aug 2012 19:34:11 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJYBvJ026372; Sun, 19 Aug 2012 19:34:11 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191934.q7JJYBvJ026372@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239399 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 19:34:11 -0000 Author: andreast Date: Sun Aug 19 19:34:10 2012 New Revision: 239399 URL: http://svn.freebsd.org/changeset/base/239399 Log: Unify the sysctl description with the other PowerMac temperature drivers. Modified: head/sys/dev/iicbus/ds1775.c Modified: head/sys/dev/iicbus/ds1775.c ============================================================================== --- head/sys/dev/iicbus/ds1775.c Sun Aug 19 19:32:38 2012 (r239398) +++ head/sys/dev/iicbus/ds1775.c Sun Aug 19 19:34:10 2012 (r239399) @@ -172,12 +172,11 @@ ds1775_start(void *xdev) { phandle_t child; struct ds1775_softc *sc; - struct sysctl_oid *sensroot_oid; + struct sysctl_oid *oid, *sensroot_oid; struct sysctl_ctx_list *ctx; ssize_t plen; int i; char sysctl_name[40], sysctl_desc[40]; - const char *units; device_t dev = (device_t)xdev; @@ -186,7 +185,9 @@ ds1775_start(void *xdev) child = ofw_bus_get_node(dev); ctx = device_get_sysctl_ctx(dev); - sensroot_oid = device_get_sysctl_tree(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", + CTLFLAG_RD, 0, "DS1775 Sensor Information"); if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, sizeof(int)) < 0) @@ -194,7 +195,6 @@ ds1775_start(void *xdev) plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name, sizeof(sc->sc_sensor.name)); - units = "C"; if (plen == -1) { strcpy(sysctl_name, "sensor"); @@ -221,9 +221,11 @@ ds1775_start(void *xdev) (int (*)(struct pmac_therm *sc))(ds1775_sensor_read); pmac_thermal_sensor_register(&sc->sc_sensor); - sprintf(sysctl_desc,"%s (%s)", sc->sc_sensor.name, units); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO, - sysctl_name, + sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, 0, ds1775_sensor_sysctl, "IK", sysctl_desc);