Minor style(9) changes

o use prototype definition
o use mse_{isa,cbus}_{probe,attach,detach} in preference to
  mse_{probe,attach,detach}.
This commit is contained in:
Warner Losh 2005-04-08 05:22:58 +00:00
parent 26f6218be9
commit 48c6558f4a
3 changed files with 47 additions and 104 deletions

View File

@ -135,7 +135,7 @@ mse_common_attach(device_t dev)
}
if (BUS_SETUP_INTR(device_get_parent(dev), dev, sc->sc_intr,
INTR_TYPE_TTY, mseintr, sc, &sc->sc_ih)) {
INTR_TYPE_TTY, mseintr, sc, &sc->sc_ih)) {
bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port);
bus_release_resource(dev, SYS_RES_IRQ, rid, sc->sc_intr);
return ENXIO;
@ -145,9 +145,9 @@ mse_common_attach(device_t dev)
callout_handle_init(&sc->sc_callout);
sc->sc_dev = make_dev(&mse_cdevsw, unit << 1, 0, 0, 0600,
"mse%d", unit);
"mse%d", unit);
sc->sc_ndev = make_dev(&mse_cdevsw, (unit<<1)+1, 0, 0, 0600,
"nmse%d", unit);
"nmse%d", unit);
return 0;
}
@ -155,11 +155,7 @@ mse_common_attach(device_t dev)
* Exclusive open the mouse, initialize it and enable interrupts.
*/
static int
mseopen(dev, flags, fmt, td)
struct cdev *dev;
int flags;
int fmt;
struct thread *td;
mseopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
mse_softc_t *sc;
int s;
@ -195,11 +191,7 @@ mseopen(dev, flags, fmt, td)
* mseclose: just turn off mouse innterrupts.
*/
static int
mseclose(dev, flags, fmt, td)
struct cdev *dev;
int flags;
int fmt;
struct thread *td;
mseclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
int s;
@ -219,10 +211,7 @@ mseclose(dev, flags, fmt, td)
* (Yes this is cheesy, but it makes the X386 server happy, so...)
*/
static int
mseread(dev, uio, ioflag)
struct cdev *dev;
struct uio *uio;
int ioflag;
mseread(struct cdev *dev, struct uio *uio, int ioflag)
{
mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
int xfer, s, error;
@ -286,12 +275,7 @@ mseread(dev, uio, ioflag)
* mseioctl: process ioctl commands.
*/
static int
mseioctl(dev, cmd, addr, flag, td)
struct cdev *dev;
u_long cmd;
caddr_t addr;
int flag;
struct thread *td;
mseioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
mousestatus_t status;
@ -403,10 +387,7 @@ mseioctl(dev, cmd, addr, flag, td)
* msepoll: check for mouse input to be processed.
*/
static int
msepoll(dev, events, td)
struct cdev *dev;
int events;
struct thread *td;
msepoll(struct cdev *dev, int events, struct thread *td)
{
mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
int s;
@ -434,8 +415,7 @@ msepoll(dev, events, td)
* msetimeout: watchdog timer routine.
*/
static void
msetimeout(arg)
void *arg;
msetimeout(void *arg)
{
struct cdev *dev;
mse_softc_t *sc;
@ -455,8 +435,7 @@ msetimeout(arg)
* mseintr: update mouse status. sc_deltax and sc_deltay are accumulative.
*/
static void
mseintr(arg)
void *arg;
mseintr(void *arg)
{
/*
* the table to turn MouseSystem button bits (MOUSE_MSC_BUTTON?UP)

View File

@ -90,14 +90,14 @@
#include <dev/mse/msevar.h>
static int mse_probe(device_t dev);
static int mse_attach(device_t dev);
static int mse_detach(device_t dev);
static int mse_cbus_probe(device_t dev);
static int mse_cbus_attach(device_t dev);
static int mse_cbus_detach(device_t dev);
static device_method_t mse_methods[] = {
DEVMETHOD(device_probe, mse_probe),
DEVMETHOD(device_attach, mse_attach),
DEVMETHOD(device_detach, mse_detach),
DEVMETHOD(device_probe, mse_cbus_probe),
DEVMETHOD(device_attach, mse_cbus_attach),
DEVMETHOD(device_detach, mse_cbus_detach),
{ 0, 0 }
};
@ -151,9 +151,8 @@ static struct mse_types mse_types[] = {
{ 0, },
};
static int
mse_probe(dev)
device_t dev;
static int
mse_cbus_probe(device_t dev)
{
mse_softc_t *sc;
int error;
@ -201,9 +200,8 @@ mse_probe(dev)
return ENXIO;
}
static int
mse_attach(dev)
device_t dev;
static int
mse_cbus_attach(device_t dev)
{
mse_softc_t *sc;
int rid;
@ -225,9 +223,8 @@ mse_attach(dev)
return (mse_common_attach(dev));
}
static int
mse_detach(dev)
device_t dev;
static int
mse_cbus_detach(device_t dev)
{
mse_softc_t *sc;
int rid;
@ -256,9 +253,7 @@ mse_detach(dev)
* (do not enable interrupts)
*/
static int
mse_probe98m(dev, sc)
device_t dev;
mse_softc_t *sc;
mse_probe98m(device_t dev, mse_softc_t *sc)
{
/* mode set */
bus_space_write_1(sc->sc_iot, sc->sc_ioh, MODE, 0x93);
@ -278,9 +273,7 @@ mse_probe98m(dev, sc)
* Initialize PC98 bus mouse and enable interrupts.
*/
static void
mse_enable98m(tag, handle)
bus_space_tag_t tag;
bus_space_handle_t handle;
mse_enable98m(bus_space_tag_t tag, bus_space_handle_t handle)
{
bus_space_write_1(tag, handle, INT, INT_ENABLE); /* INT enable */
bus_space_write_1(tag, handle, HC, HC_NO_CLEAR); /* HC = 0 */
@ -291,9 +284,7 @@ mse_enable98m(tag, handle)
* Disable interrupts for PC98 Bus mouse.
*/
static void
mse_disable98m(tag, handle)
bus_space_tag_t tag;
bus_space_handle_t handle;
mse_disable98m(bus_space_tag_t tag, bus_space_handle_t handle)
{
bus_space_write_1(tag, handle, INT, INT_DISABLE); /* INT disable */
bus_space_write_1(tag, handle, HC, HC_NO_CLEAR); /* HC = 0 */
@ -304,12 +295,8 @@ mse_disable98m(tag, handle)
* Get current dx, dy and up/down button state.
*/
static void
mse_get98m(tag, handle, dx, dy, but)
bus_space_tag_t tag;
bus_space_handle_t handle;
int *dx;
int *dy;
int *but;
mse_get98m(bus_space_tag_t tag, bus_space_handle_t handle, int *dx, int *dy,
int *but)
{
register char x, y;

View File

@ -90,14 +90,14 @@
#include <dev/mse/msevar.h>
static int mse_probe(device_t dev);
static int mse_attach(device_t dev);
static int mse_detach(device_t dev);
static int mse_isa_probe(device_t dev);
static int mse_isa_attach(device_t dev);
static int mse_isa_detach(device_t dev);
static device_method_t mse_methods[] = {
DEVMETHOD(device_probe, mse_probe),
DEVMETHOD(device_attach, mse_attach),
DEVMETHOD(device_detach, mse_detach),
DEVMETHOD(device_probe, mse_isa_probe),
DEVMETHOD(device_attach, mse_isa_attach),
DEVMETHOD(device_detach, mse_isa_detach),
{ 0, 0 }
};
@ -196,8 +196,7 @@ static struct mse_types mse_types[] = {
};
static int
mse_probe(dev)
device_t dev;
mse_isa_probe(device_t dev)
{
mse_softc_t *sc;
int error;
@ -242,8 +241,7 @@ mse_probe(dev)
}
static int
mse_attach(dev)
device_t dev;
mse_isa_attach(device_t dev)
{
mse_softc_t *sc;
int rid;
@ -262,8 +260,7 @@ mse_attach(dev)
}
static int
mse_detach(dev)
device_t dev;
mse_isa_detach(device_t dev)
{
mse_softc_t *sc;
int rid;
@ -292,9 +289,7 @@ mse_detach(dev)
* interrupts and return 1)
*/
static int
mse_probelogi(dev, sc)
device_t dev;
mse_softc_t *sc;
mse_probelogi(device_t dev, mse_softc_t *sc)
{
int sig;
@ -320,9 +315,7 @@ mse_probelogi(dev, sc)
* Initialize Logitech mouse and enable interrupts.
*/
static void
mse_enablelogi(tag, handle)
bus_space_tag_t tag;
bus_space_handle_t handle;
mse_enablelogi(bus_space_tag_t tag, bus_space_handle_t handle)
{
int dx, dy, but;
@ -334,9 +327,7 @@ mse_enablelogi(tag, handle)
* Disable interrupts for Logitech mouse.
*/
static void
mse_disablelogi(tag, handle)
bus_space_tag_t tag;
bus_space_handle_t handle;
mse_disablelogi(bus_space_tag_t tag, bus_space_handle_t handle)
{
bus_space_write_1(tag, handle, MSE_PORTC, MSE_DISINTR);
@ -346,12 +337,8 @@ mse_disablelogi(tag, handle)
* Get the current dx, dy and button up/down state.
*/
static void
mse_getlogi(tag, handle, dx, dy, but)
bus_space_tag_t tag;
bus_space_handle_t handle;
int *dx;
int *dy;
int *but;
mse_getlogi(bus_space_tag_t tag, bus_space_handle_t handle, int *dx, int *dy,
int *but)
{
register char x, y;
@ -378,9 +365,7 @@ mse_getlogi(tag, handle, dx, dy, but)
* (do not enable interrupts)
*/
static int
mse_probeati(dev, sc)
device_t dev;
mse_softc_t *sc;
mse_probeati(device_t dev, mse_softc_t *sc)
{
int i;
@ -394,9 +379,7 @@ mse_probeati(dev, sc)
* Initialize ATI Inport mouse and enable interrupts.
*/
static void
mse_enableati(tag, handle)
bus_space_tag_t tag;
bus_space_handle_t handle;
mse_enableati(bus_space_tag_t tag, bus_space_handle_t handle)
{
bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_RESET);
@ -408,9 +391,7 @@ mse_enableati(tag, handle)
* Disable interrupts for ATI Inport mouse.
*/
static void
mse_disableati(tag, handle)
bus_space_tag_t tag;
bus_space_handle_t handle;
mse_disableati(bus_space_tag_t tag, bus_space_handle_t handle)
{
bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_MODE);
@ -421,14 +402,10 @@ mse_disableati(tag, handle)
* Get current dx, dy and up/down button state.
*/
static void
mse_getati(tag, handle, dx, dy, but)
bus_space_tag_t tag;
bus_space_handle_t handle;
int *dx;
int *dy;
int *but;
mse_getati(bus_space_tag_t tag, bus_space_handle_t handle, int *dx, int *dy,
int *but)
{
register char byte;
char byte;
bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_MODE);
bus_space_write_1(tag, handle, MSE_PORTB, MSE_INPORT_HOLD);