From ee1591cd11414dcc5bbcb3df9aadb4e83675fc9b Mon Sep 17 00:00:00 2001 From: thompsa Date: Sun, 1 Feb 2009 00:51:25 +0000 Subject: [PATCH] Remove check for null softc in attach, it can never happen. --- sys/dev/usb2/controller/at91dci_atmelarm.c | 3 --- sys/dev/usb2/controller/ehci2_pci.c | 4 ---- sys/dev/usb2/controller/musb2_otg_atmelarm.c | 4 ---- sys/dev/usb2/controller/ohci2_atmelarm.c | 3 --- sys/dev/usb2/controller/ohci2_pci.c | 4 ---- sys/dev/usb2/controller/uhci2_pci.c | 4 ---- sys/dev/usb2/controller/uss820dci_atmelarm.c | 4 ---- sys/dev/usb2/core/usb2_compat_linux.c | 3 --- sys/dev/usb2/core/usb2_hub.c | 3 --- sys/dev/usb2/ethernet/if_aue2.c | 3 --- sys/dev/usb2/ethernet/if_axe2.c | 3 --- sys/dev/usb2/ethernet/if_cdce2.c | 3 --- sys/dev/usb2/ethernet/if_cue2.c | 3 --- sys/dev/usb2/ethernet/if_kue2.c | 3 --- sys/dev/usb2/ethernet/if_rue2.c | 3 --- sys/dev/usb2/ethernet/if_udav2.c | 3 --- sys/dev/usb2/input/uhid2.c | 3 --- sys/dev/usb2/input/ukbd2.c | 3 --- sys/dev/usb2/misc/udbp2.c | 6 ------ sys/dev/usb2/misc/ufm2.c | 3 --- sys/dev/usb2/serial/u3g2.c | 3 --- sys/dev/usb2/serial/uark2.c | 3 --- sys/dev/usb2/serial/ubsa2.c | 3 --- sys/dev/usb2/serial/ubser2.c | 3 --- sys/dev/usb2/serial/uchcom2.c | 3 --- sys/dev/usb2/serial/ucycom2.c | 3 --- sys/dev/usb2/serial/ufoma2.c | 3 --- sys/dev/usb2/serial/uftdi2.c | 3 --- sys/dev/usb2/serial/ugensa2.c | 3 --- sys/dev/usb2/serial/uipaq2.c | 3 --- sys/dev/usb2/serial/umct2.c | 3 --- sys/dev/usb2/serial/umodem2.c | 3 --- sys/dev/usb2/serial/umoscom2.c | 3 --- sys/dev/usb2/serial/uplcom2.c | 3 --- sys/dev/usb2/serial/uvisor2.c | 3 --- sys/dev/usb2/serial/uvscom2.c | 3 --- sys/dev/usb2/sound/uaudio2.c | 3 --- sys/dev/usb2/storage/ata-usb2.c | 3 --- sys/dev/usb2/storage/umass2.c | 3 --- sys/dev/usb2/storage/urio2.c | 3 --- sys/dev/usb2/storage/ustorage2_fs.c | 3 --- sys/dev/usb2/wlan/if_rum2.c | 3 --- sys/dev/usb2/wlan/if_ural2.c | 3 --- sys/dev/usb2/wlan/if_zyd2.c | 3 --- 44 files changed, 140 deletions(-) diff --git a/sys/dev/usb2/controller/at91dci_atmelarm.c b/sys/dev/usb2/controller/at91dci_atmelarm.c index 5ce562568cca..496eade9d3a3 100644 --- a/sys/dev/usb2/controller/at91dci_atmelarm.c +++ b/sys/dev/usb2/controller/at91dci_atmelarm.c @@ -131,9 +131,6 @@ at91_udp_attach(device_t dev) int err; int rid; - if (sc == NULL) { - return (ENXIO); - } /* setup AT9100 USB device controller interface softc */ sc->sc_dci.sc_clocks_on = &at91_udp_clocks_on; diff --git a/sys/dev/usb2/controller/ehci2_pci.c b/sys/dev/usb2/controller/ehci2_pci.c index 4ca43d9b21c6..038211d4d5d3 100644 --- a/sys/dev/usb2/controller/ehci2_pci.c +++ b/sys/dev/usb2/controller/ehci2_pci.c @@ -227,10 +227,6 @@ ehci_pci_attach(device_t self) int err; int rid; - if (sc == NULL) { - device_printf(self, "Could not allocate sc\n"); - return (ENXIO); - } /* initialise some bus fields */ sc->sc_bus.parent = self; sc->sc_bus.devices = sc->sc_devices; diff --git a/sys/dev/usb2/controller/musb2_otg_atmelarm.c b/sys/dev/usb2/controller/musb2_otg_atmelarm.c index 44fa32056091..6477c971fb25 100644 --- a/sys/dev/usb2/controller/musb2_otg_atmelarm.c +++ b/sys/dev/usb2/controller/musb2_otg_atmelarm.c @@ -90,11 +90,7 @@ musbotg_attach(device_t dev) int err; int rid; - if (sc == NULL) { - return (ENXIO); - } /* setup MUSB OTG USB controller interface softc */ - sc->sc_otg.sc_clocks_on = &musbotg_clocks_on; sc->sc_otg.sc_clocks_off = &musbotg_clocks_off; sc->sc_otg.sc_clocks_arg = sc; diff --git a/sys/dev/usb2/controller/ohci2_atmelarm.c b/sys/dev/usb2/controller/ohci2_atmelarm.c index 41e7b10f9629..a7f086c1a6c5 100644 --- a/sys/dev/usb2/controller/ohci2_atmelarm.c +++ b/sys/dev/usb2/controller/ohci2_atmelarm.c @@ -69,9 +69,6 @@ ohci_atmelarm_attach(device_t dev) int err; int rid; - if (sc == NULL) { - return (ENXIO); - } /* initialise some bus fields */ sc->sc_ohci.sc_bus.parent = dev; sc->sc_ohci.sc_bus.devices = sc->sc_ohci.sc_devices; diff --git a/sys/dev/usb2/controller/ohci2_pci.c b/sys/dev/usb2/controller/ohci2_pci.c index 09a4cdf9264f..7d3506e193a0 100644 --- a/sys/dev/usb2/controller/ohci2_pci.c +++ b/sys/dev/usb2/controller/ohci2_pci.c @@ -195,10 +195,6 @@ ohci_pci_attach(device_t self) int rid; int err; - if (sc == NULL) { - device_printf(self, "Could not allocate sc\n"); - return (ENXIO); - } /* initialise some bus fields */ sc->sc_bus.parent = self; sc->sc_bus.devices = sc->sc_devices; diff --git a/sys/dev/usb2/controller/uhci2_pci.c b/sys/dev/usb2/controller/uhci2_pci.c index 70cbd3a91172..725cd84bc4d5 100644 --- a/sys/dev/usb2/controller/uhci2_pci.c +++ b/sys/dev/usb2/controller/uhci2_pci.c @@ -246,10 +246,6 @@ uhci_pci_attach(device_t self) int rid; int err; - if (sc == NULL) { - device_printf(self, "Could not allocate sc\n"); - return (ENXIO); - } /* initialise some bus fields */ sc->sc_bus.parent = self; sc->sc_bus.devices = sc->sc_devices; diff --git a/sys/dev/usb2/controller/uss820dci_atmelarm.c b/sys/dev/usb2/controller/uss820dci_atmelarm.c index 1d484a223eef..387c1675f271 100644 --- a/sys/dev/usb2/controller/uss820dci_atmelarm.c +++ b/sys/dev/usb2/controller/uss820dci_atmelarm.c @@ -134,10 +134,6 @@ uss820_atmelarm_attach(device_t dev) int err; int rid; - if (sc == NULL) { - return (ENXIO); - } - /* initialise some bus fields */ sc->sc_bus.parent = dev; sc->sc_bus.devices = sc->sc_devices; diff --git a/sys/dev/usb2/core/usb2_compat_linux.c b/sys/dev/usb2/core/usb2_compat_linux.c index b632cf0cdce7..4f52ea394216 100644 --- a/sys/dev/usb2/core/usb2_compat_linux.c +++ b/sys/dev/usb2/core/usb2_compat_linux.c @@ -246,9 +246,6 @@ usb_linux_attach(device_t dev) struct usb_device *p_dev; const struct usb_device_id *id = NULL; - if (sc == NULL) { - return (ENOMEM); - } mtx_lock(&Giant); LIST_FOREACH(udrv, &usb_linux_driver_list, linux_driver_list) { id = usb_linux_lookup_id(udrv->id_table, uaa); diff --git a/sys/dev/usb2/core/usb2_hub.c b/sys/dev/usb2/core/usb2_hub.c index 709fdeb23080..47db1199920c 100644 --- a/sys/dev/usb2/core/usb2_hub.c +++ b/sys/dev/usb2/core/usb2_hub.c @@ -649,9 +649,6 @@ uhub_attach(device_t dev) uint8_t iface_index; usb2_error_t err; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = udev; sc->sc_dev = dev; diff --git a/sys/dev/usb2/ethernet/if_aue2.c b/sys/dev/usb2/ethernet/if_aue2.c index e9236158cc50..f30a712b61e3 100644 --- a/sys/dev/usb2/ethernet/if_aue2.c +++ b/sys/dev/usb2/ethernet/if_aue2.c @@ -752,9 +752,6 @@ aue_attach(device_t dev) int32_t error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/ethernet/if_axe2.c b/sys/dev/usb2/ethernet/if_axe2.c index d152dc2ebd0c..dd154c0b50fb 100644 --- a/sys/dev/usb2/ethernet/if_axe2.c +++ b/sys/dev/usb2/ethernet/if_axe2.c @@ -629,9 +629,6 @@ axe_attach(device_t dev) int32_t error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/ethernet/if_cdce2.c b/sys/dev/usb2/ethernet/if_cdce2.c index 6b56c7ea82f1..89081d7e33d1 100644 --- a/sys/dev/usb2/ethernet/if_cdce2.c +++ b/sys/dev/usb2/ethernet/if_cdce2.c @@ -231,9 +231,6 @@ cdce_attach(device_t dev) uint8_t eaddr[ETHER_ADDR_LEN]; char eaddr_str[5 * ETHER_ADDR_LEN]; /* approx */ - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/ethernet/if_cue2.c b/sys/dev/usb2/ethernet/if_cue2.c index fc1adfb44ff1..9a765d856c39 100644 --- a/sys/dev/usb2/ethernet/if_cue2.c +++ b/sys/dev/usb2/ethernet/if_cue2.c @@ -397,9 +397,6 @@ cue_attach(device_t dev) uint8_t iface_index; int32_t error; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/ethernet/if_kue2.c b/sys/dev/usb2/ethernet/if_kue2.c index b579b1d34603..b4e6bbe53f72 100644 --- a/sys/dev/usb2/ethernet/if_kue2.c +++ b/sys/dev/usb2/ethernet/if_kue2.c @@ -459,9 +459,6 @@ kue_attach(device_t dev) int32_t error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/ethernet/if_rue2.c b/sys/dev/usb2/ethernet/if_rue2.c index fe34d1fc2a1e..93e306f6a05b 100644 --- a/sys/dev/usb2/ethernet/if_rue2.c +++ b/sys/dev/usb2/ethernet/if_rue2.c @@ -637,9 +637,6 @@ rue_attach(device_t dev) int32_t error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/ethernet/if_udav2.c b/sys/dev/usb2/ethernet/if_udav2.c index 99ee63ccad5d..a5fde41dd083 100644 --- a/sys/dev/usb2/ethernet/if_udav2.c +++ b/sys/dev/usb2/ethernet/if_udav2.c @@ -267,9 +267,6 @@ udav_attach(device_t dev) int32_t error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/input/uhid2.c b/sys/dev/usb2/input/uhid2.c index 95d03ffa116a..4713b06df3f3 100644 --- a/sys/dev/usb2/input/uhid2.c +++ b/sys/dev/usb2/input/uhid2.c @@ -660,9 +660,6 @@ uhid_attach(device_t dev) DPRINTFN(10, "sc=%p\n", sc); - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); mtx_init(&sc->sc_mtx, "uhid lock", NULL, MTX_DEF | MTX_RECURSE); diff --git a/sys/dev/usb2/input/ukbd2.c b/sys/dev/usb2/input/ukbd2.c index f3b01b0b0c4c..487e5607c743 100644 --- a/sys/dev/usb2/input/ukbd2.c +++ b/sys/dev/usb2/input/ukbd2.c @@ -625,9 +625,6 @@ ukbd_attach(device_t dev) usb2_error_t err; uint16_t n; - if (sc == NULL) { - return (ENOMEM); - } mtx_assert(&Giant, MA_OWNED); kbd_init_struct(kbd, UKBD_DRIVER_NAME, KB_OTHER, unit, 0, 0, 0); diff --git a/sys/dev/usb2/misc/udbp2.c b/sys/dev/usb2/misc/udbp2.c index 03e4d6ca56d1..97136e4bdcf6 100644 --- a/sys/dev/usb2/misc/udbp2.c +++ b/sys/dev/usb2/misc/udbp2.c @@ -320,9 +320,6 @@ udbp_attach(device_t dev) struct udbp_softc *sc = device_get_softc(dev); int error; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); snprintf(sc->sc_name, sizeof(sc->sc_name), @@ -476,9 +473,6 @@ udbp_bulk_read_complete(node_p node, hook_p hook, void *arg1, int arg2) struct mbuf *m; int error; - if (sc == NULL) { - return; - } mtx_lock(&sc->sc_mtx); m = sc->sc_bulk_in_buffer; diff --git a/sys/dev/usb2/misc/ufm2.c b/sys/dev/usb2/misc/ufm2.c index c37fdf659c24..5be828ce5531 100644 --- a/sys/dev/usb2/misc/ufm2.c +++ b/sys/dev/usb2/misc/ufm2.c @@ -130,9 +130,6 @@ ufm_attach(device_t dev) struct ufm_softc *sc = device_get_softc(dev); int error; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/serial/u3g2.c b/sys/dev/usb2/serial/u3g2.c index e97b4ffe25c0..472b74a0dfb5 100644 --- a/sys/dev/usb2/serial/u3g2.c +++ b/sys/dev/usb2/serial/u3g2.c @@ -391,9 +391,6 @@ u3g_attach(device_t dev) DPRINTF("sc=%p\n", sc); - if (sc == NULL) { - return (ENOMEM); - } /* copy in USB config */ for (n = 0; n != U3G_N_TRANSFER; n++) u3g_config_tmp[n] = u3g_config[n]; diff --git a/sys/dev/usb2/serial/uark2.c b/sys/dev/usb2/serial/uark2.c index e0e0e6055e9e..1c6558c17add 100644 --- a/sys/dev/usb2/serial/uark2.c +++ b/sys/dev/usb2/serial/uark2.c @@ -209,9 +209,6 @@ uark_attach(device_t dev) int32_t error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->sc_udev = uaa->device; diff --git a/sys/dev/usb2/serial/ubsa2.c b/sys/dev/usb2/serial/ubsa2.c index eccc22f525a6..e9b149ffe5d8 100644 --- a/sys/dev/usb2/serial/ubsa2.c +++ b/sys/dev/usb2/serial/ubsa2.c @@ -329,9 +329,6 @@ ubsa_attach(device_t dev) DPRINTF("sc=%p\n", sc); - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->sc_udev = uaa->device; diff --git a/sys/dev/usb2/serial/ubser2.c b/sys/dev/usb2/serial/ubser2.c index 5447fc8109b8..40366be3baba 100644 --- a/sys/dev/usb2/serial/ubser2.c +++ b/sys/dev/usb2/serial/ubser2.c @@ -256,9 +256,6 @@ ubser_attach(device_t dev) uint8_t n; int error; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); snprintf(sc->sc_name, sizeof(sc->sc_name), "%s", diff --git a/sys/dev/usb2/serial/uchcom2.c b/sys/dev/usb2/serial/uchcom2.c index 8aeef4e344af..c2c39e635edc 100644 --- a/sys/dev/usb2/serial/uchcom2.c +++ b/sys/dev/usb2/serial/uchcom2.c @@ -342,9 +342,6 @@ uchcom_attach(device_t dev) DPRINTFN(11, "\n"); - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->sc_udev = uaa->device; diff --git a/sys/dev/usb2/serial/ucycom2.c b/sys/dev/usb2/serial/ucycom2.c index 3cb3b5be2291..7a820321468d 100644 --- a/sys/dev/usb2/serial/ucycom2.c +++ b/sys/dev/usb2/serial/ucycom2.c @@ -216,9 +216,6 @@ ucycom_attach(device_t dev) uint16_t urd_len; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; device_set_usb2_desc(dev); diff --git a/sys/dev/usb2/serial/ufoma2.c b/sys/dev/usb2/serial/ufoma2.c index 31efec161df7..9596ebdd0bbd 100644 --- a/sys/dev/usb2/serial/ufoma2.c +++ b/sys/dev/usb2/serial/ufoma2.c @@ -407,9 +407,6 @@ ufoma_attach(device_t dev) uint8_t elements; int32_t error; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/serial/uftdi2.c b/sys/dev/usb2/serial/uftdi2.c index db9d20afd2e6..663e70208007 100644 --- a/sys/dev/usb2/serial/uftdi2.c +++ b/sys/dev/usb2/serial/uftdi2.c @@ -286,9 +286,6 @@ uftdi_attach(device_t dev) struct uftdi_softc *sc = device_get_softc(dev); int error; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/serial/ugensa2.c b/sys/dev/usb2/serial/ugensa2.c index 9476de0aaec4..b54a5f894f11 100644 --- a/sys/dev/usb2/serial/ugensa2.c +++ b/sys/dev/usb2/serial/ugensa2.c @@ -215,9 +215,6 @@ ugensa_attach(device_t dev) uint8_t iface_index; int x, cnt; - if (sc == NULL) - return (ENOMEM); - device_set_usb2_desc(dev); mtx_init(&sc->sc_mtx, "ugensa", NULL, MTX_DEF); diff --git a/sys/dev/usb2/serial/uipaq2.c b/sys/dev/usb2/serial/uipaq2.c index bfcdf228c3c4..e80b62b575f7 100644 --- a/sys/dev/usb2/serial/uipaq2.c +++ b/sys/dev/usb2/serial/uipaq2.c @@ -1129,9 +1129,6 @@ uipaq_attach(device_t dev) uint8_t iface_index; uint8_t i; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; device_set_usb2_desc(dev); diff --git a/sys/dev/usb2/serial/umct2.c b/sys/dev/usb2/serial/umct2.c index 23aea40b3984..9395f0b7addc 100644 --- a/sys/dev/usb2/serial/umct2.c +++ b/sys/dev/usb2/serial/umct2.c @@ -273,9 +273,6 @@ umct_attach(device_t dev) uint16_t maxp; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_unit = device_get_unit(dev); diff --git a/sys/dev/usb2/serial/umodem2.c b/sys/dev/usb2/serial/umodem2.c index 00e34294ac94..86d2326d5399 100644 --- a/sys/dev/usb2/serial/umodem2.c +++ b/sys/dev/usb2/serial/umodem2.c @@ -322,9 +322,6 @@ umodem_attach(device_t dev) uint8_t i; int error; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->sc_ctrl_iface_no = uaa->info.bIfaceNum; diff --git a/sys/dev/usb2/serial/umoscom2.c b/sys/dev/usb2/serial/umoscom2.c index 9a8a47da5eae..19be5b22fece 100644 --- a/sys/dev/usb2/serial/umoscom2.c +++ b/sys/dev/usb2/serial/umoscom2.c @@ -335,9 +335,6 @@ umoscom_attach(device_t dev) int error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_udev = uaa->device; sc->sc_mcr = 0x08; /* enable interrupts */ diff --git a/sys/dev/usb2/serial/uplcom2.c b/sys/dev/usb2/serial/uplcom2.c index 8b70cbc2ee02..ddc0a1f7cd06 100644 --- a/sys/dev/usb2/serial/uplcom2.c +++ b/sys/dev/usb2/serial/uplcom2.c @@ -371,9 +371,6 @@ uplcom_attach(device_t dev) DPRINTFN(11, "\n"); - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); DPRINTF("sc = %p\n", sc); diff --git a/sys/dev/usb2/serial/uvisor2.c b/sys/dev/usb2/serial/uvisor2.c index 6bd972ff6595..468751e34927 100644 --- a/sys/dev/usb2/serial/uvisor2.c +++ b/sys/dev/usb2/serial/uvisor2.c @@ -321,9 +321,6 @@ uvisor_attach(device_t dev) DPRINTF("sc=%p\n", sc); bcopy(uvisor_config, uvisor_config_copy, sizeof(uvisor_config_copy)); - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->sc_udev = uaa->device; diff --git a/sys/dev/usb2/serial/uvscom2.c b/sys/dev/usb2/serial/uvscom2.c index 30fd01603ba6..05e886ec87aa 100644 --- a/sys/dev/usb2/serial/uvscom2.c +++ b/sys/dev/usb2/serial/uvscom2.c @@ -315,9 +315,6 @@ uvscom_attach(device_t dev) struct uvscom_softc *sc = device_get_softc(dev); int error; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->sc_udev = uaa->device; diff --git a/sys/dev/usb2/sound/uaudio2.c b/sys/dev/usb2/sound/uaudio2.c index 13021061036b..cf4c1607683f 100644 --- a/sys/dev/usb2/sound/uaudio2.c +++ b/sys/dev/usb2/sound/uaudio2.c @@ -562,9 +562,6 @@ uaudio_attach(device_t dev) struct usb2_interface_descriptor *id; device_t child; - if (sc == NULL) { - return (ENOMEM); - } sc->sc_play_chan.priv_sc = sc; sc->sc_rec_chan.priv_sc = sc; sc->sc_udev = uaa->device; diff --git a/sys/dev/usb2/storage/ata-usb2.c b/sys/dev/usb2/storage/ata-usb2.c index f72ac9ffe5c1..430e59bc95e6 100644 --- a/sys/dev/usb2/storage/ata-usb2.c +++ b/sys/dev/usb2/storage/ata-usb2.c @@ -328,9 +328,6 @@ atausb2_attach(device_t dev) uint8_t has_intr; int err; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->dev = dev; diff --git a/sys/dev/usb2/storage/umass2.c b/sys/dev/usb2/storage/umass2.c index dd5d77b1db34..1674f745dbae 100644 --- a/sys/dev/usb2/storage/umass2.c +++ b/sys/dev/usb2/storage/umass2.c @@ -1444,9 +1444,6 @@ umass_attach(device_t dev) struct usb2_interface_descriptor *id; int32_t err; - if (sc == NULL) { - return (ENOMEM); - } if (device_get_unit(dev) >= UMASS_MAXUNIT) { device_printf(dev, "Maxunit(%u) limit reached!\n", UMASS_MAXUNIT); diff --git a/sys/dev/usb2/storage/urio2.c b/sys/dev/usb2/storage/urio2.c index ff4d819e5290..f5b631500f04 100644 --- a/sys/dev/usb2/storage/urio2.c +++ b/sys/dev/usb2/storage/urio2.c @@ -212,9 +212,6 @@ urio_attach(device_t dev) struct urio_softc *sc = device_get_softc(dev); int error; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); sc->sc_udev = uaa->device; diff --git a/sys/dev/usb2/storage/ustorage2_fs.c b/sys/dev/usb2/storage/ustorage2_fs.c index 6c606d5fcfd7..78b05922a294 100644 --- a/sys/dev/usb2/storage/ustorage2_fs.c +++ b/sys/dev/usb2/storage/ustorage2_fs.c @@ -318,9 +318,6 @@ ustorage_fs_attach(device_t dev) struct usb2_interface_descriptor *id; int err; - if (sc == NULL) { - return (ENOMEM); - } /* * NOTE: the softc struct is bzero-ed in device_set_driver. * We can safely call ustorage_fs_detach without specifically diff --git a/sys/dev/usb2/wlan/if_rum2.c b/sys/dev/usb2/wlan/if_rum2.c index b11d614aec00..df6706138bd7 100644 --- a/sys/dev/usb2/wlan/if_rum2.c +++ b/sys/dev/usb2/wlan/if_rum2.c @@ -461,9 +461,6 @@ rum_attach(device_t dev) int error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); mtx_init(&sc->sc_mtx, "rum lock", MTX_NETWORK_LOCK, diff --git a/sys/dev/usb2/wlan/if_ural2.c b/sys/dev/usb2/wlan/if_ural2.c index 0cb7bdd256be..2a66ce0268e0 100644 --- a/sys/dev/usb2/wlan/if_ural2.c +++ b/sys/dev/usb2/wlan/if_ural2.c @@ -453,9 +453,6 @@ ural_attach(device_t dev) int error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } device_set_usb2_desc(dev); mtx_init(&sc->sc_mtx, "ural lock", MTX_NETWORK_LOCK, diff --git a/sys/dev/usb2/wlan/if_zyd2.c b/sys/dev/usb2/wlan/if_zyd2.c index 281035d2c6a3..5b61f0088919 100644 --- a/sys/dev/usb2/wlan/if_zyd2.c +++ b/sys/dev/usb2/wlan/if_zyd2.c @@ -1069,9 +1069,6 @@ zyd_attach(device_t dev) int error; uint8_t iface_index; - if (sc == NULL) { - return (ENOMEM); - } if (uaa->info.bcdDevice < 0x4330) { device_printf(dev, "device version mismatch: 0x%X " "(only >= 43.30 supported)\n",