From 06edd2a82fc72407ae4304d79f08e7904794f0f5 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Thu, 19 May 2016 09:18:43 +0000 Subject: Use OF_is_compatible(9). Simplifies the code and should make pci within a guest domain on a Fujitsu M10 work. --- sys/arch/sparc64/dev/vpci.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'sys/arch/sparc64/dev') 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 * @@ -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 -- cgit v1.2.3