Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/isa PR port-i386/54701: deal with missing pmf platfo...
details: https://anonhg.NetBSD.org/src/rev/47fffe317eea
branches: trunk
changeset: 461115:47fffe317eea
user: martin <martin%NetBSD.org@localhost>
date: Sat Nov 16 15:38:43 2019 +0000
description:
PR port-i386/54701: deal with missing pmf platform keys.
diffstat:
sys/dev/isa/nct.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diffs (46 lines):
diff -r 782ebf411f82 -r 47fffe317eea sys/dev/isa/nct.c
--- a/sys/dev/isa/nct.c Sat Nov 16 13:25:33 2019 +0000
+++ b/sys/dev/isa/nct.c Sat Nov 16 15:38:43 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nct.c,v 1.1 2019/10/25 17:39:57 martin Exp $ */
+/* $NetBSD: nct.c,v 1.2 2019/11/16 15:38:43 martin Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nct.c,v 1.1 2019/10/25 17:39:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nct.c,v 1.2 2019/11/16 15:38:43 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -241,6 +241,7 @@
int nioaddr, i;
u_int8_t low, high;
u_int16_t id;
+ const char *vendor, *product;
/*
* Allow override of I/O base address. If no I/O base address is
@@ -249,11 +250,15 @@
if (ia->ia_nio > 0 && ia->ia_io[0].ir_addr != ISA_UNKNOWN_PORT) {
ioaddrs[0] = ia->ia_io[0].ir_addr;
nioaddr = 1;
- } else if ((strcmp(pmf_get_platform("system-vendor"), "PC Engines") |
- strcmp(pmf_get_platform("system-product"), "APU")) == 0) {
- nioaddr = __arraycount(ioaddrs);
} else {
- nioaddr = 0;
+ vendor = pmf_get_platform("system-vendor");
+ product = pmf_get_platform("system-product");
+ if (vendor != NULL && strcmp(vendor, "PC Engines") == 0 &&
+ product != NULL && strcmp(product, "APU") == 0) {
+ nioaddr = __arraycount(ioaddrs);
+ } else {
+ nioaddr = 0;
+ }
}
/*
Home |
Main Index |
Thread Index |
Old Index