diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2012-09-30 02:16:18 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2012-09-30 02:16:18 +0000 |
commit | 331ad846998b344080549879f03115881213a729 (patch) | |
tree | e951b0a6ba1573daf77f09dbcebb8ddd2dba7d83 /sys/dev | |
parent | 672195e34d15e04d87cd857103da6093cc94e376 (diff) |
Simplify the gem(4) variant detection code a bit.
ok haesbaert@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_gem_pci.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sys/dev/pci/if_gem_pci.c b/sys/dev/pci/if_gem_pci.c index e164b6f3bed..80c8b8a18d3 100644 --- a/sys/dev/pci/if_gem_pci.c +++ b/sys/dev/pci/if_gem_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gem_pci.c,v 1.32 2011/04/03 15:36:02 jasper Exp $ */ +/* $OpenBSD: if_gem_pci.c,v 1.33 2012/09/30 02:16:17 brad Exp $ */ /* $NetBSD: if_gem_pci.c,v 1.1 2001/09/16 00:11:42 eeh Exp $ */ /* @@ -227,22 +227,19 @@ gem_attach_pci(struct device *parent, struct device *self, void *aux) sc->sc_pci = 1; /* XXXXX should all be done in bus_dma. */ - if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SUN_GEMNETWORK) + switch (PCI_PRODUCT(pa->pa_id)) { + case PCI_PRODUCT_SUN_GEMNETWORK: sc->sc_variant = GEM_SUN_GEM; - else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SUN_ERINETWORK) + break; + case PCI_PRODUCT_SUN_ERINETWORK: sc->sc_variant = GEM_SUN_ERI; - else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_INTREPID2_GMAC) - sc->sc_variant = GEM_APPLE_GMAC; - else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_PANGEA_GMAC) - sc->sc_variant = GEM_APPLE_GMAC; - else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_SHASTA_GMAC) - sc->sc_variant = GEM_APPLE_GMAC; - else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_UNINORTHGMAC) - sc->sc_variant = GEM_APPLE_GMAC; - else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_UNINORTH2GMAC) - sc->sc_variant = GEM_APPLE_GMAC; - else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_K2_GMAC) + break; + case PCI_PRODUCT_APPLE_K2_GMAC: sc->sc_variant = GEM_APPLE_K2_GMAC; + break; + default: + sc->sc_variant = GEM_APPLE_GMAC; + } #define PCI_GEM_BASEADDR 0x10 if (pci_mapreg_map(pa, PCI_GEM_BASEADDR, type, 0, |