svn commit: r187970 - in head/sys/dev/usb2: controller core ethernet input misc serial sound storage wlan

Andrew Thompson thompsa at FreeBSD.org
Sat Jan 31 16:51:28 PST 2009


Author: thompsa
Date: Sun Feb  1 00:51:25 2009
New Revision: 187970
URL: http://svn.freebsd.org/changeset/base/187970

Log:
  Remove check for null softc in attach, it can never happen.

Modified:
  head/sys/dev/usb2/controller/at91dci_atmelarm.c
  head/sys/dev/usb2/controller/ehci2_pci.c
  head/sys/dev/usb2/controller/musb2_otg_atmelarm.c
  head/sys/dev/usb2/controller/ohci2_atmelarm.c
  head/sys/dev/usb2/controller/ohci2_pci.c
  head/sys/dev/usb2/controller/uhci2_pci.c
  head/sys/dev/usb2/controller/uss820dci_atmelarm.c
  head/sys/dev/usb2/core/usb2_compat_linux.c
  head/sys/dev/usb2/core/usb2_hub.c
  head/sys/dev/usb2/ethernet/if_aue2.c
  head/sys/dev/usb2/ethernet/if_axe2.c
  head/sys/dev/usb2/ethernet/if_cdce2.c
  head/sys/dev/usb2/ethernet/if_cue2.c
  head/sys/dev/usb2/ethernet/if_kue2.c
  head/sys/dev/usb2/ethernet/if_rue2.c
  head/sys/dev/usb2/ethernet/if_udav2.c
  head/sys/dev/usb2/input/uhid2.c
  head/sys/dev/usb2/input/ukbd2.c
  head/sys/dev/usb2/misc/udbp2.c
  head/sys/dev/usb2/misc/ufm2.c
  head/sys/dev/usb2/serial/u3g2.c
  head/sys/dev/usb2/serial/uark2.c
  head/sys/dev/usb2/serial/ubsa2.c
  head/sys/dev/usb2/serial/ubser2.c
  head/sys/dev/usb2/serial/uchcom2.c
  head/sys/dev/usb2/serial/ucycom2.c
  head/sys/dev/usb2/serial/ufoma2.c
  head/sys/dev/usb2/serial/uftdi2.c
  head/sys/dev/usb2/serial/ugensa2.c
  head/sys/dev/usb2/serial/uipaq2.c
  head/sys/dev/usb2/serial/umct2.c
  head/sys/dev/usb2/serial/umodem2.c
  head/sys/dev/usb2/serial/umoscom2.c
  head/sys/dev/usb2/serial/uplcom2.c
  head/sys/dev/usb2/serial/uvisor2.c
  head/sys/dev/usb2/serial/uvscom2.c
  head/sys/dev/usb2/sound/uaudio2.c
  head/sys/dev/usb2/storage/ata-usb2.c
  head/sys/dev/usb2/storage/umass2.c
  head/sys/dev/usb2/storage/urio2.c
  head/sys/dev/usb2/storage/ustorage2_fs.c
  head/sys/dev/usb2/wlan/if_rum2.c
  head/sys/dev/usb2/wlan/if_ural2.c
  head/sys/dev/usb2/wlan/if_zyd2.c

Modified: head/sys/dev/usb2/controller/at91dci_atmelarm.c
==============================================================================
--- head/sys/dev/usb2/controller/at91dci_atmelarm.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/controller/at91dci_atmelarm.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/controller/ehci2_pci.c
==============================================================================
--- head/sys/dev/usb2/controller/ehci2_pci.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/controller/ehci2_pci.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/controller/musb2_otg_atmelarm.c
==============================================================================
--- head/sys/dev/usb2/controller/musb2_otg_atmelarm.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/controller/musb2_otg_atmelarm.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/controller/ohci2_atmelarm.c
==============================================================================
--- head/sys/dev/usb2/controller/ohci2_atmelarm.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/controller/ohci2_atmelarm.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/controller/ohci2_pci.c
==============================================================================
--- head/sys/dev/usb2/controller/ohci2_pci.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/controller/ohci2_pci.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/controller/uhci2_pci.c
==============================================================================
--- head/sys/dev/usb2/controller/uhci2_pci.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/controller/uhci2_pci.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/controller/uss820dci_atmelarm.c
==============================================================================
--- head/sys/dev/usb2/controller/uss820dci_atmelarm.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/controller/uss820dci_atmelarm.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/core/usb2_compat_linux.c
==============================================================================
--- head/sys/dev/usb2/core/usb2_compat_linux.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/core/usb2_compat_linux.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/core/usb2_hub.c
==============================================================================
--- head/sys/dev/usb2/core/usb2_hub.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/core/usb2_hub.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;
 

Modified: head/sys/dev/usb2/ethernet/if_aue2.c
==============================================================================
--- head/sys/dev/usb2/ethernet/if_aue2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/ethernet/if_aue2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/ethernet/if_axe2.c
==============================================================================
--- head/sys/dev/usb2/ethernet/if_axe2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/ethernet/if_axe2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/ethernet/if_cdce2.c
==============================================================================
--- head/sys/dev/usb2/ethernet/if_cdce2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/ethernet/if_cdce2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/ethernet/if_cue2.c
==============================================================================
--- head/sys/dev/usb2/ethernet/if_cue2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/ethernet/if_cue2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/ethernet/if_kue2.c
==============================================================================
--- head/sys/dev/usb2/ethernet/if_kue2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/ethernet/if_kue2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/ethernet/if_rue2.c
==============================================================================
--- head/sys/dev/usb2/ethernet/if_rue2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/ethernet/if_rue2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/ethernet/if_udav2.c
==============================================================================
--- head/sys/dev/usb2/ethernet/if_udav2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/ethernet/if_udav2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/input/uhid2.c
==============================================================================
--- head/sys/dev/usb2/input/uhid2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/input/uhid2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/input/ukbd2.c
==============================================================================
--- head/sys/dev/usb2/input/ukbd2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/input/ukbd2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/misc/udbp2.c
==============================================================================
--- head/sys/dev/usb2/misc/udbp2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/misc/udbp2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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, hoo
 	struct mbuf *m;
 	int error;
 
-	if (sc == NULL) {
-		return;
-	}
 	mtx_lock(&sc->sc_mtx);
 
 	m = sc->sc_bulk_in_buffer;

Modified: head/sys/dev/usb2/misc/ufm2.c
==============================================================================
--- head/sys/dev/usb2/misc/ufm2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/misc/ufm2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);
 

Modified: head/sys/dev/usb2/serial/u3g2.c
==============================================================================
--- head/sys/dev/usb2/serial/u3g2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/u3g2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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];

Modified: head/sys/dev/usb2/serial/uark2.c
==============================================================================
--- head/sys/dev/usb2/serial/uark2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/uark2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/serial/ubsa2.c
==============================================================================
--- head/sys/dev/usb2/serial/ubsa2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/ubsa2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/serial/ubser2.c
==============================================================================
--- head/sys/dev/usb2/serial/ubser2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/ubser2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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",

Modified: head/sys/dev/usb2/serial/uchcom2.c
==============================================================================
--- head/sys/dev/usb2/serial/uchcom2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/uchcom2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/serial/ucycom2.c
==============================================================================
--- head/sys/dev/usb2/serial/ucycom2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/ucycom2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/serial/ufoma2.c
==============================================================================
--- head/sys/dev/usb2/serial/ufoma2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/ufoma2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/serial/uftdi2.c
==============================================================================
--- head/sys/dev/usb2/serial/uftdi2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/uftdi2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/serial/ugensa2.c
==============================================================================
--- head/sys/dev/usb2/serial/ugensa2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/ugensa2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);
 

Modified: head/sys/dev/usb2/serial/uipaq2.c
==============================================================================
--- head/sys/dev/usb2/serial/uipaq2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/uipaq2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/serial/umct2.c
==============================================================================
--- head/sys/dev/usb2/serial/umct2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/umct2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);
 

Modified: head/sys/dev/usb2/serial/umodem2.c
==============================================================================
--- head/sys/dev/usb2/serial/umodem2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/umodem2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/serial/umoscom2.c
==============================================================================
--- head/sys/dev/usb2/serial/umoscom2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/umoscom2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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 */
 

Modified: head/sys/dev/usb2/serial/uplcom2.c
==============================================================================
--- head/sys/dev/usb2/serial/uplcom2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/uplcom2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/serial/uvisor2.c
==============================================================================
--- head/sys/dev/usb2/serial/uvisor2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/uvisor2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/serial/uvscom2.c
==============================================================================
--- head/sys/dev/usb2/serial/uvscom2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/serial/uvscom2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/sound/uaudio2.c
==============================================================================
--- head/sys/dev/usb2/sound/uaudio2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/sound/uaudio2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/storage/ata-usb2.c
==============================================================================
--- head/sys/dev/usb2/storage/ata-usb2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/storage/ata-usb2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/storage/umass2.c
==============================================================================
--- head/sys/dev/usb2/storage/umass2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/storage/umass2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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);

Modified: head/sys/dev/usb2/storage/urio2.c
==============================================================================
--- head/sys/dev/usb2/storage/urio2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/storage/urio2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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;

Modified: head/sys/dev/usb2/storage/ustorage2_fs.c
==============================================================================
--- head/sys/dev/usb2/storage/ustorage2_fs.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/storage/ustorage2_fs.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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

Modified: head/sys/dev/usb2/wlan/if_rum2.c
==============================================================================
--- head/sys/dev/usb2/wlan/if_rum2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/wlan/if_rum2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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,

Modified: head/sys/dev/usb2/wlan/if_ural2.c
==============================================================================
--- head/sys/dev/usb2/wlan/if_ural2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/wlan/if_ural2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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,

Modified: head/sys/dev/usb2/wlan/if_zyd2.c
==============================================================================
--- head/sys/dev/usb2/wlan/if_zyd2.c	Sun Feb  1 00:50:46 2009	(r187969)
+++ head/sys/dev/usb2/wlan/if_zyd2.c	Sun Feb  1 00:51:25 2009	(r187970)
@@ -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",


More information about the svn-src-head mailing list