diff options
author | Warner Losh <imp@FreeBSD.org> | 2007-06-09 06:39:43 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2007-06-09 06:39:43 +0000 |
commit | 80170fd0c4eee22a3b1f51fac4a98974727f89de (patch) | |
tree | af8426b0f5c3233d268a819b768cbaeacd406358 | |
parent | 7f5ede581993ffe0f48f6cbfb9bc4d98666b9443 (diff) | |
download | src-80170fd0c4eee22a3b1f51fac4a98974727f89de.tar.gz src-80170fd0c4eee22a3b1f51fac4a98974727f89de.zip |
Kill devinfo stuff. It is no longer needed.
Kill bogus bzero as necessary.
Minor tidy.
Expand USB_ATTACH_SETUP inline where needed.
Notes
Notes:
svn path=/head/; revision=170452
-rw-r--r-- | sys/dev/usb/uark.c | 11 | ||||
-rw-r--r-- | sys/dev/usb/ubsa.c | 12 | ||||
-rw-r--r-- | sys/dev/usb/ubser.c | 9 | ||||
-rw-r--r-- | sys/dev/usb/ucycom.c | 9 | ||||
-rw-r--r-- | sys/dev/usb/udbp.c | 4 |
5 files changed, 2 insertions, 43 deletions
diff --git a/sys/dev/usb/uark.c b/sys/dev/usb/uark.c index 5aefc9ffe317..fb6ea8924ee2 100644 --- a/sys/dev/usb/uark.c +++ b/sys/dev/usb/uark.c @@ -131,14 +131,10 @@ USB_ATTACH(uark) usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; usbd_status error; - char *devinfo; const char *devname; int i; struct ucom_softc *ucom = &sc->sc_ucom; - devinfo = malloc(1024, M_USBDEV, M_WAITOK); - - bzero(ucom, sizeof(struct ucom_softc)); ucom->sc_dev = self; ucom->sc_udev = dev; @@ -162,9 +158,6 @@ USB_ATTACH(uark) } else iface = uaa->iface; - usbd_devinfo(dev, 0, devinfo); - printf("%s: %s\n", devname, devinfo); - id = usbd_get_interface_descriptor(iface); ucom->sc_iface = iface; @@ -197,15 +190,11 @@ USB_ATTACH(uark) DPRINTF(("uark: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no)); ucom_attach(&sc->sc_ucom); - free(devinfo, M_USBDEV); - USB_ATTACH_SUCCESS_RETURN; bad: DPRINTF(("uftdi_attach: ATTACH ERROR\n")); ucom->sc_dying = 1; - free(devinfo, M_USBDEV); - USB_ATTACH_ERROR_RETURN; } diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c index aeb7bf5ab9b9..58be7e43d1f7 100644 --- a/sys/dev/usb/ubsa.c +++ b/sys/dev/usb/ubsa.c @@ -283,17 +283,13 @@ USB_ATTACH(ubsa) usb_config_descriptor_t *cdesc; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - char *devinfo; const char *devname; usbd_status err; int i; dev = uaa->device; - devinfo = malloc(1024, M_USBDEV, M_WAITOK); ucom = &sc->sc_ucom; - bzero(sc, sizeof (struct ubsa_softc)); - /* * initialize rts, dtr variables to something * different from boolean 0, 1 @@ -301,17 +297,12 @@ USB_ATTACH(ubsa) sc->sc_dtr = -1; sc->sc_rts = -1; - usbd_devinfo(dev, 0, devinfo); - /* USB_ATTACH_SETUP; */ ucom->sc_dev = self; - device_set_desc_copy(self, devinfo); - /* USB_ATTACH_SETUP; */ ucom->sc_udev = dev; ucom->sc_iface = uaa->iface; devname = device_get_nameunit(ucom->sc_dev); - printf("%s: %s\n", devname, devinfo); DPRINTF(("ubsa attach: sc = %p\n", sc)); @@ -414,12 +405,9 @@ USB_ATTACH(ubsa) TASK_INIT(&sc->sc_task, 0, ubsa_notify, sc); ucom_attach(ucom); - - free(devinfo, M_USBDEV); USB_ATTACH_SUCCESS_RETURN; error: - free(devinfo, M_USBDEV); USB_ATTACH_ERROR_RETURN; } diff --git a/sys/dev/usb/ubser.c b/sys/dev/usb/ubser.c index 4a97a9556e3f..1a71b419bf7e 100644 --- a/sys/dev/usb/ubser.c +++ b/sys/dev/usb/ubser.c @@ -225,7 +225,6 @@ USB_ATTACH(ubser) usb_endpoint_descriptor_t *ed; usb_interface_descriptor_t *id; usb_device_request_t req; - char *devinfo; struct tty *tp; usbd_status err; int i; @@ -233,9 +232,7 @@ USB_ATTACH(ubser) uint8_t epcount; struct ubser_port *pp; - devinfo = malloc(1024, M_USBDEV, M_WAITOK); - usbd_devinfo(udev, 0, devinfo); - USB_ATTACH_SETUP; + sc->sc_dev = self; DPRINTFN(10,("\nubser_attach: sc=%p\n", sc)); @@ -376,8 +373,6 @@ USB_ATTACH(ubser) } ubserstartread(sc); - - free(devinfo, M_USBDEV); USB_ATTACH_SUCCESS_RETURN; fail_4: @@ -413,8 +408,6 @@ bad: } DPRINTF(("ubser_attach: ATTACH ERROR\n")); - free(devinfo, M_USBDEV); - USB_ATTACH_ERROR_RETURN; } diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index 9d6dee7ec05e..b5623f6a7f80 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -177,7 +177,6 @@ ucycom_attach(device_t dev) struct ucycom_softc *sc; struct ucycom_device *ud; usb_endpoint_descriptor_t *ued; - char *devinfo; void *urd; int error, urdlen; @@ -188,14 +187,6 @@ ucycom_attach(device_t dev) sc->sc_dev = dev; sc->sc_usbdev = uaa->device; - /* get device description */ - /* XXX usb_devinfo() has little or no overflow protection */ - devinfo = malloc(1024, M_USBDEV, M_WAITOK); - usbd_devinfo(sc->sc_usbdev, 0, devinfo); - device_set_desc_copy(dev, devinfo); - device_printf(dev, "%s\n", devinfo); - free(devinfo, M_USBDEV); - /* get chip model */ for (ud = ucycom_devices; ud->model != 0; ++ud) if (ud->vendor == uaa->vendor && ud->product == uaa->product) diff --git a/sys/dev/usb/udbp.c b/sys/dev/usb/udbp.c index f63dffca0583..fd6ecb594f0f 100644 --- a/sys/dev/usb/udbp.c +++ b/sys/dev/usb/udbp.c @@ -255,7 +255,6 @@ USB_ATTACH(udbp) usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed, *ed_bulkin = NULL, *ed_bulkout = NULL; usbd_status err; - char devinfo[1024]; int i; static int ngudbp_done_init=0; @@ -263,8 +262,7 @@ USB_ATTACH(udbp) /* fetch the interface handle for the first interface */ (void) usbd_device2interface_handle(uaa->device, 0, &iface); id = usbd_get_interface_descriptor(iface); - usbd_devinfo(uaa->device, USBD_SHOW_INTERFACE_CLASS, devinfo); - USB_ATTACH_SETUP; + sc->sc_dev = self; /* Find the two first bulk endpoints */ for (i = 0 ; i < id->bNumEndpoints; i++) { |