Hi!
nothing major, just some fluff here and there.
--
Alexandr Shadchin
Index: pckbc_isa.c
===================================================================
RCS file: /cvs/src/sys/dev/isa/pckbc_isa.c,v
retrieving revision 1.7
diff -u -p -r1.7 pckbc_isa.c
--- pckbc_isa.c 22 Jul 2010 14:27:46 -0000 1.7
+++ pckbc_isa.c 21 Aug 2010 00:34:16 -0000
@@ -28,17 +28,12 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/errno.h>
-#include <sys/queue.h>
-#include <sys/lock.h>
+#include <sys/malloc.h>
#include <machine/bus.h>
-#include <dev/isa/isareg.h>
+#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
#include <dev/ic/i8042reg.h>
@@ -63,15 +58,12 @@ struct cfattach pckbc_isa_ca = {
void pckbc_isa_intr_establish(struct pckbc_softc *, pckbc_slot_t);
int
-pckbc_isa_match(parent, match, aux)
- struct device *parent;
- void *match;
- void *aux;
+pckbc_isa_match(struct device *parent, void *match, void *aux)
{
struct isa_attach_args *ia = aux;
bus_space_tag_t iot = ia->ia_iot;
bus_space_handle_t ioh_d, ioh_c;
- int res, ok = 1;
+ int res;
/* If values are hardwired to something that they can't be, punt. */
if ((ia->ia_iobase != IOBASEUNK && ia->ia_iobase != IO_KBD) ||
@@ -92,26 +84,26 @@ pckbc_isa_match(parent, match, aux)
(void) pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_KBD_SLOT, 0);
/* KBC selftest */
- if (pckbc_send_cmd(iot, ioh_c, KBC_SELFTEST) == 0) {
- ok = 0;
+ if (pckbc_send_cmd(iot, ioh_c, KBC_SELFTEST) == 0)
goto out;
- }
res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_KBD_SLOT, 0);
if (res != 0x55) {
printf("kbc selftest: %x\n", res);
- ok = 0;
+ goto out;
}
- out:
- bus_space_unmap(iot, ioh_d, 1);
- bus_space_unmap(iot, ioh_c, 1);
}
- if (ok) {
- ia->ia_iobase = IO_KBD;
- ia->ia_iosize = 5;
- ia->ia_msize = 0x0;
- }
- return (ok);
+ ia->ia_iobase = IO_KBD;
+ ia->ia_iosize = 5;
+ ia->ia_msize = 0;
+
+ return (1);
+
+ out:
+ bus_space_unmap(iot, ioh_d, 1);
+ bus_space_unmap(iot, ioh_c, 1);
+
+ return (0);
}
int
@@ -132,9 +124,7 @@ pckbc_isa_activate(struct device *self,
}
void
-pckbc_isa_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
+pckbc_isa_attach(struct device *parent, struct device *self, void *aux)
{
struct pckbc_isa_softc *isc = (void *)self;
struct pckbc_softc *sc = &isc->sc_pckbc;
@@ -159,8 +149,6 @@ pckbc_isa_attach(parent, self, aux)
if (pckbc_is_console(iot, IO_KBD)) {
t = &pckbc_consdata;
- ioh_d = t->t_ioh_d;
- ioh_c = t->t_ioh_c;
pckbc_console_attached = 1;
/* t->t_cmdbyte was initialized by cnattach */
} else {
@@ -186,9 +174,7 @@ pckbc_isa_attach(parent, self, aux)
}
void
-pckbc_isa_intr_establish(sc, slot)
- struct pckbc_softc *sc;
- pckbc_slot_t slot;
+pckbc_isa_intr_establish(struct pckbc_softc *sc, pckbc_slot_t slot)
{
struct pckbc_isa_softc *isc = (void *) sc;
void *rv;