Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev remove more old pci_findvendor code



details:   https://anonhg.NetBSD.org/src/rev/34b840bd7537
branches:  trunk
changeset: 802578:34b840bd7537
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 21 15:07:19 2014 +0000

description:
remove more old pci_findvendor code

diffstat:

 sys/dev/cardbus/ehci_cardbus.c |  13 ++++---------
 sys/dev/cardbus/ohci_cardbus.c |  13 ++++---------
 sys/dev/cardbus/uhci_cardbus.c |  13 ++++---------
 sys/dev/pci/cs4280.c           |   9 ++++-----
 4 files changed, 16 insertions(+), 32 deletions(-)

diffs (159 lines):

diff -r 448b0c6eac75 -r 34b840bd7537 sys/dev/cardbus/ehci_cardbus.c
--- a/sys/dev/cardbus/ehci_cardbus.c    Sun Sep 21 14:32:37 2014 +0000
+++ b/sys/dev/cardbus/ehci_cardbus.c    Sun Sep 21 15:07:19 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci_cardbus.c,v 1.31 2011/08/01 11:20:27 drochner Exp $       */
+/*     $NetBSD: ehci_cardbus.c,v 1.32 2014/09/21 15:07:19 christos Exp $       */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.31 2011/08/01 11:20:27 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.32 2014/09/21 15:07:19 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -129,7 +129,6 @@
        pcireg_t csr;
        char devinfo[256];
        usbd_status r;
-       const char *vendor;
        u_int ncomp;
        const char *devname = device_xname(self);
        struct usb_cardbus *up;
@@ -171,13 +170,9 @@
        }
 
        /* Figure out vendor for root hub descriptor. */
-       vendor = pci_findvendor(ca->ca_id);
        sc->sc.sc_id_vendor = PCI_VENDOR(ca->ca_id);
-       if (vendor)
-               strlcpy(sc->sc.sc_vendor, vendor, sizeof(sc->sc.sc_vendor));
-       else
-               snprintf(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
-                   "vendor 0x%04x", PCI_VENDOR(ca->ca_id));
+       pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
+           sc->sc.sc_id_vendor);
 
        /*
         * Find companion controllers.  According to the spec they always
diff -r 448b0c6eac75 -r 34b840bd7537 sys/dev/cardbus/ohci_cardbus.c
--- a/sys/dev/cardbus/ohci_cardbus.c    Sun Sep 21 14:32:37 2014 +0000
+++ b/sys/dev/cardbus/ohci_cardbus.c    Sun Sep 21 15:07:19 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci_cardbus.c,v 1.39 2011/08/01 11:20:28 drochner Exp $       */
+/*     $NetBSD: ohci_cardbus.c,v 1.40 2014/09/21 15:07:19 christos Exp $       */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.39 2011/08/01 11:20:28 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.40 2014/09/21 15:07:19 christos Exp $");
 
 #include "ehci_cardbus.h"
 
@@ -109,7 +109,6 @@
        pcireg_t csr;
        char devinfo[256];
        usbd_status r;
-       const char *vendor;
        const char *devname = device_xname(self);
 
        sc->sc.sc_dev = self;
@@ -149,13 +148,9 @@
        }
 
        /* Figure out vendor for root hub descriptor. */
-       vendor = pci_findvendor(ca->ca_id);
        sc->sc.sc_id_vendor = PCI_VENDOR(ca->ca_id);
-       if (vendor)
-               strlcpy(sc->sc.sc_vendor, vendor, sizeof(sc->sc.sc_vendor));
-       else
-               snprintf(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
-                   "vendor 0x%04x", PCI_VENDOR(ca->ca_id));
+       pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
+           sc->sc.sc_id_vendor);
 
        r = ohci_init(&sc->sc);
        if (r != USBD_NORMAL_COMPLETION) {
diff -r 448b0c6eac75 -r 34b840bd7537 sys/dev/cardbus/uhci_cardbus.c
--- a/sys/dev/cardbus/uhci_cardbus.c    Sun Sep 21 14:32:37 2014 +0000
+++ b/sys/dev/cardbus/uhci_cardbus.c    Sun Sep 21 15:07:19 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci_cardbus.c,v 1.20 2011/08/01 11:20:28 drochner Exp $       */
+/*     $NetBSD: uhci_cardbus.c,v 1.21 2014/09/21 15:07:19 christos Exp $       */
 
 /*
  * Copyright (c) 1998-2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.20 2011/08/01 11:20:28 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.21 2014/09/21 15:07:19 christos Exp $");
 
 #include "ehci_cardbus.h"
 
@@ -98,7 +98,6 @@
        cardbus_function_tag_t cf = ct->ct_cf;
        pcitag_t tag = ca->ca_tag;
        pcireg_t csr;
-       const char *vendor;
        const char *devname = device_xname(self);
        char devinfo[256];
        usbd_status r;
@@ -156,13 +155,9 @@
        }
 
        /* Figure out vendor for root hub descriptor. */
-       vendor = pci_findvendor(ca->ca_id);
        sc->sc.sc_id_vendor = PCI_VENDOR(ca->ca_id);
-       if (vendor)
-               strlcpy(sc->sc.sc_vendor, vendor, sizeof(sc->sc.sc_vendor));
-       else
-               snprintf(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
-                   "vendor 0x%04x", PCI_VENDOR(ca->ca_id));
+       pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
+           sc->sc.sc_id_vendor);
 
        r = uhci_init(&sc->sc);
        if (r != USBD_NORMAL_COMPLETION) {
diff -r 448b0c6eac75 -r 34b840bd7537 sys/dev/pci/cs4280.c
--- a/sys/dev/pci/cs4280.c      Sun Sep 21 14:32:37 2014 +0000
+++ b/sys/dev/pci/cs4280.c      Sun Sep 21 15:07:19 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cs4280.c,v 1.67 2014/09/21 14:30:22 christos Exp $     */
+/*     $NetBSD: cs4280.c,v 1.68 2014/09/21 15:07:19 christos Exp $     */
 
 /*
  * Copyright (c) 1999, 2000 Tatoku Ogaito.  All rights reserved.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.67 2014/09/21 14:30:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.68 2014/09/21 15:07:19 christos Exp $");
 
 #include "midi.h"
 
@@ -241,12 +241,11 @@
        pci_chipset_tag_t pc;
        const struct cs4280_card_t *cs_card;
        char const *intrstr;
-       const char *vendor, *product;
        pcireg_t reg;
        uint32_t mem;
        int error;
-       chae vendor[PCI_VENDORSTR_LEN];
-       chae product[PCI_PRODUCTSTR_LEN];
+       char vendor[PCI_VENDORSTR_LEN];
+       char product[PCI_PRODUCTSTR_LEN];
        char intrbuf[PCI_INTRSTR_LEN];
 
        sc = device_private(self);



Home | Main Index | Thread Index | Old Index