PERFORCE change 123917 for review
Rui Paulo
rpaulo at FreeBSD.org
Sun Jul 22 17:47:04 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=123917
Change 123917 by rpaulo at rpaulo_epsilon on 2007/07/22 17:46:35
Stop creating a child node in the sysctl hw tree and start using
the device tree provided by newbus.
Affected files ...
.. //depot/projects/soc2007/rpaulo-macbook/dev/backlight/backlight.c#10 edit
Differences ...
==== //depot/projects/soc2007/rpaulo-macbook/dev/backlight/backlight.c#10 (text+ko) ====
@@ -23,7 +23,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/backlight/backlight.c#9 $
+ * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/backlight/backlight.c#10 $
*
*/
@@ -175,21 +175,14 @@
if (error)
return (error);
- sysctl_ctx_init(&sc->sc_sysctl_ctx);
- sc->sc_sysctl_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx,
- SYSCTL_STATIC_CHILDREN(_hw),
- OID_AUTO,
- device_get_name(dev),
- CTLFLAG_RD, 0, "");
-
- SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
- SYSCTL_CHILDREN(sc->sc_sysctl_tree),
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "enable", CTLTYPE_INT | CTLFLAG_RW,
sc, 0, model->bm_enable, "I",
"Turn the backlight on/off");
- SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx,
- SYSCTL_CHILDREN(sc->sc_sysctl_tree),
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "level", CTLTYPE_INT | CTLFLAG_RW,
sc, 0, model->bm_level, "I",
"Brightness level of the backlight");
@@ -200,10 +193,6 @@
static int
backlight_detach(device_t dev)
{
- struct backlight_softc *sc = device_get_softc(dev);
-
- sysctl_ctx_free(&sc->sc_sysctl_ctx);
-
return (0);
}
More information about the p4-projects
mailing list