summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-10-28 23:44:38 +0000
committerriastradh <riastradh@NetBSD.org>2022-10-28 23:44:38 +0000
commitc9f1d8c593b2b76956edf337c592d3fc07bd5f7c (patch)
treea42bdc00775b90a20dfe50b2183e5daef91a595a /sys/dev/ic
parent047884ffde50f5da6a2c0e0ae2236fb3a934cb3c (diff)
pckbc(4): Simplify the (disabled) logic to check keyboard port.
No functional change intended -- just reduces code duplication (and fixes wrong-number-of-arguments in #if 0 logic).
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/pckbc.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c
index 326394dd1a7..e815bbd53f5 100644
--- a/sys/dev/ic/pckbc.c
+++ b/sys/dev/ic/pckbc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc.c,v 1.63 2022/10/28 23:40:37 riastradh Exp $ */
+/* $NetBSD: pckbc.c,v 1.64 2022/10/28 23:44:38 riastradh Exp $ */
/*
* Copyright (c) 2004 Ben Harris.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.63 2022/10/28 23:40:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.64 2022/10/28 23:44:38 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -311,27 +311,23 @@ pckbc_attach(struct pckbc_softc *sc)
*/
if (!pckbc_send_cmd(iot, ioh_c, KBC_KBDTEST))
return;
- res = pckbc_poll_data1(t, PCKBC_KBD_SLOT, 0);
+ res = pckbc_poll_data1(t, PCKBC_KBD_SLOT);
/*
* Normally, we should get a "0" here.
* But there are keyboard controllers behaving differently.
*/
- if (res == 0 || res == 0xfa || res == 0x01 || res == 0xab) {
-#ifdef PCKBCDEBUG
- if (res != 0)
- printf("pckbc: returned %x on kbd slot test\n", res);
-#endif
- if (pckbc_attach_slot(sc, PCKBC_KBD_SLOT))
- cmdbits |= KC8_KENABLE;
- } else {
+ if (!(res == 0 || res == 0xfa || res == 0x01 || res == 0xab)) {
printf("pckbc: kbd port test: %x\n", res);
return;
}
-#else
+#ifdef PCKBCDEBUG
+ if (res != 0)
+ printf("pckbc: returned %x on kbd slot test\n", res);
+#endif
+#endif /* 0 */
if (pckbc_attach_slot(sc, PCKBC_KBD_SLOT))
cmdbits |= KC8_KENABLE;
-#endif /* 0 */
/*
* Check aux port ok.