diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-05-19 09:18:43 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-05-19 09:18:43 +0000 |
commit | 06edd2a82fc72407ae4304d79f08e7904794f0f5 (patch) | |
tree | c9df8b80dd99d1f3771c791d0ab10d4f0511a9fd /sys/arch/sparc64/dev | |
parent | faa451ff5a538bb0a69c0da83adcd1fec6dd5fd2 (diff) |
Use OF_is_compatible(9). Simplifies the code and should make pci within
a guest domain on a Fujitsu M10 work.
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r-- | sys/arch/sparc64/dev/vpci.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c index 354eb340572..7a126e35e66 100644 --- a/sys/arch/sparc64/dev/vpci.c +++ b/sys/arch/sparc64/dev/vpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vpci.c,v 1.19 2015/09/27 11:29:20 kettenis Exp $ */ +/* $OpenBSD: vpci.c,v 1.20 2016/05/19 09:18:42 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org> * @@ -135,18 +135,11 @@ int vpci_match(struct device *parent, void *match, void *aux) { struct mainbus_attach_args *ma = aux; - char compat[32]; if (strcmp(ma->ma_name, "pci") != 0) return (0); - if (OF_getprop(ma->ma_node, "compatible", compat, sizeof(compat)) == -1) - return (0); - - if (strcmp(compat, "SUNW,sun4v-pci") == 0) - return (1); - - return (0); + return OF_is_compatible(ma->ma_node, "SUNW,sun4v-pci"); } void |