From aa1315c6049b97fc57924044418ec4ea8c584905 Mon Sep 17 00:00:00 2001 From: uwe Date: Fri, 1 Jun 2007 17:44:46 +0000 Subject: [PATCH] Cosmetic. Use device_xname. Don't compile debugging support. Drop out-of-date comment for j6x0tp_attach (we haven't been using submatch for quite a while). --- sys/arch/hpcsh/dev/j6x0tp.c | 42 ++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/sys/arch/hpcsh/dev/j6x0tp.c b/sys/arch/hpcsh/dev/j6x0tp.c index 9c71af9defc1..45f6aa918378 100644 --- a/sys/arch/hpcsh/dev/j6x0tp.c +++ b/sys/arch/hpcsh/dev/j6x0tp.c @@ -1,4 +1,4 @@ -/* $NetBSD: j6x0tp.c,v 1.16 2007/03/04 05:59:54 christos Exp $ */ +/* $NetBSD: j6x0tp.c,v 1.17 2007/06/01 17:44:46 uwe Exp $ */ /* * Copyright (c) 2003 Valeriy E. Ushakov @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.16 2007/03/04 05:59:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.17 2007/06/01 17:44:46 uwe Exp $"); #include #include @@ -59,7 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.16 2007/03/04 05:59:54 christos Exp $") #include -#define J6X0TP_DEBUG #if 0 /* XXX: disabled in favor of local version that uses printf_nolog */ #define DPRINTF_ENABLE #define DPRINTF_DEBUG j6x0tp_debug @@ -236,12 +235,6 @@ j6x0tp_match(struct device *parent, struct cfdata *cf, void *aux) } -/* - * Attach the touch panel driver and its ws* children. - * - * Note that we have to use submatch to distinguish between children - * because ws{kbd,mouse}_match match unconditionally. - */ static void j6x0tp_attach(struct device *parent, struct device *self, void *aux) { @@ -295,7 +288,7 @@ static void j6x0tp_enable(struct j6x0tp_softc *sc) { - DPRINTFN(2, ("%s: enable\n", sc->sc_dev.dv_xname)); + DPRINTFN(2, ("%s: enable\n", device_xname(&sc->sc_dev))); intc_intr_enable(SH7709_INTEVT2_IRQ3); } @@ -308,7 +301,7 @@ static void j6x0tp_disable(struct j6x0tp_softc *sc) { - DPRINTFN(2, ("%s: disable\n", sc->sc_dev.dv_xname)); + DPRINTFN(2, ("%s: disable\n", device_xname(&sc->sc_dev))); intc_intr_disable(SH7709_INTEVT2_IRQ3); callout_stop(&sc->sc_touch_ch); } @@ -339,7 +332,7 @@ j6x0tp_wsmouse_enable(void *self) { struct j6x0tp_softc *sc = (struct j6x0tp_softc *)self; - DPRINTFN(1, ("%s: wsmouse enable\n", sc->sc_dev.dv_xname)); + DPRINTFN(1, ("%s: wsmouse enable\n", device_xname(&sc->sc_dev))); return (j6x0tp_set_enable(sc, 1, J6X0TP_WSMOUSE_ENABLED)); } @@ -349,7 +342,7 @@ j6x0tp_wsmouse_disable(void *self) { struct j6x0tp_softc *sc = (struct j6x0tp_softc *)self; - DPRINTFN(1, ("%s: wsmouse disable\n", sc->sc_dev.dv_xname)); + DPRINTFN(1, ("%s: wsmouse disable\n", device_xname(&sc->sc_dev))); j6x0tp_set_enable(sc, 0, J6X0TP_WSMOUSE_ENABLED); } @@ -359,7 +352,7 @@ j6x0tp_wskbd_enable(void *self, int on) { struct j6x0tp_softc *sc = (struct j6x0tp_softc *)self; - DPRINTFN(1, ("%s: wskbd %sable\n", sc->sc_dev.dv_xname, + DPRINTFN(1, ("%s: wskbd %sable\n", device_xname(&sc->sc_dev), on ? "en" : "dis")); return (j6x0tp_set_enable(sc, on, J6X0TP_WSKBD_ENABLED)); } @@ -377,13 +370,14 @@ j6x0tp_intr(void *self) irr0 = _reg_read_1(SH7709_IRR0); if ((irr0 & IRR0_IRQ3) == 0) { #ifdef DIAGNOSTIC - printf("%s: irr0 %02x?\n", sc->sc_dev.dv_xname, irr0); + printf("%s: irr0 %02x?\n", device_xname(&sc->sc_dev), irr0); #endif return (0); } if (!sc->sc_enabled) { - DPRINTFN(1, ("%s: intr: !sc_enabled\n", sc->sc_dev.dv_xname)); + DPRINTFN(1, ("%s: intr: !sc_enabled\n", + device_xname(&sc->sc_dev))); intc_intr_disable(SH7709_INTEVT2_IRQ3); goto served; } @@ -411,7 +405,7 @@ j6x0tp_intr(void *self) if (--tremor_timeout == 0) { DPRINTF(("%s: tremor timeout!\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); goto served; } } while (steady < TREMOR_THRESHOLD); @@ -427,7 +421,7 @@ j6x0tp_intr(void *self) callout_reset(&sc->sc_touch_ch, hz/32, j6x0tp_start_polling, sc); } else - DPRINTFN(1, ("%s: tremor\n", sc->sc_dev.dv_xname)); + DPRINTFN(1, ("%s: tremor\n", device_xname(&sc->sc_dev))); served: /* clear the interrupt (XXX: protect access?) */ _reg_write_1(SH7709_IRR0, irr0 & ~IRR0_IRQ3); @@ -453,13 +447,13 @@ j6x0tp_start_polling(void *self) phdr = _reg_read_1(SH7709_PHDR); if ((phdr & PHDR_TP_PEN_DOWN) == 0) { DPRINTFN(2, ("%s: start: pen is not down\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); j6x0tp_stop_polling(sc); } j6x0tp_get_raw_xy(&rawx, &rawy); DPRINTFN(2, ("%s: start: %4d %4d -> ", - sc->sc_dev.dv_xname, rawx, rawy)); + device_xname(&sc->sc_dev), rawx, rawy)); do_mouse = sc->sc_enabled & J6X0TP_WSMOUSE_ENABLED; #ifdef J6X0TP_WSMOUSE_EXCLUSIVE @@ -500,7 +494,7 @@ j6x0tp_stop_polling(struct j6x0tp_softc *sc) { uint8_t irr0; - DPRINTFN(2, ("%s: stop\n", sc->sc_dev.dv_xname)); + DPRINTFN(2, ("%s: stop\n", device_xname(&sc->sc_dev))); /* clear pending interrupt signal before re-enabling the interrupt */ irr0 = _reg_read_1(SH7709_IRR0); @@ -526,7 +520,7 @@ j6x0tp_callout_wskbd(void *self) if (!sc->sc_enabled) { DPRINTFN(1, ("%s: wskbd callout: !sc_enabled\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); splx(s); return; } @@ -562,7 +556,7 @@ j6x0tp_callout_wsmouse(void *self) if (!sc->sc_enabled) { DPRINTFN(1, ("%s: wsmouse callout: !sc_enabled\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); splx(s); return; } @@ -592,7 +586,7 @@ j6x0tp_wsmouse_input(struct j6x0tp_softc *sc, int rawx, int rawy) tpcalib_trans(&sc->sc_tpcalib, rawx, rawy, &x, &y); DPRINTFN(3, ("%s: %4d %4d -> %3d %3d\n", - sc->sc_dev.dv_xname, rawx, rawy, x, y)); + device_xname(&sc->sc_dev), rawx, rawy, x, y)); wsmouse_input(sc->sc_wsmousedev, 1, /* button */