mdelay(100); 
msleep(100); 
static int ub_probe(struct usb_interface *intf,    const struct usb_device_id *dev_id){	struct ub_dev *sc;	int nluns;	int rc;	int i;	rc = -ENOMEM;	if ((sc = kmalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL)		goto err_core;	memset(sc, 0, sizeof(struct ub_dev));	spin_lock_init(&sc->lock);	INIT_LIST_HEAD(&sc->luns);	usb_init_urb(&sc->work_urb);	tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc);	atomic_set(&sc->poison, 0);	init_timer(&sc->work_timer);	sc->work_timer.data = (unsigned long) sc;	sc->work_timer.function = ub_urb_timeout;	ub_init_completion(&sc->work_done);	sc->work_done.done = 1;		/* A little yuk, but oh well... */	sc->dev = interface_to_usbdev(intf);	sc->intf = intf;	// sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;	usb_set_intfdata(intf, sc);	usb_get_dev(sc->dev);	// usb_get_intf(sc->intf);	/* Do we need this? */	snprintf(sc->name, 12, DRV_NAME "(%d.%d)",	    sc->dev->bus->busnum, sc->dev->devnum);	/* XXX Verify that we can handle the device (from descriptors) */	ub_get_pipes(sc, sc->dev, intf);	if (device_create_file(&sc->intf->dev, &dev_attr_diag) != 0)		goto err_diag;	/*	 * At this point, all USB initialization is done, do upper layer.	 * We really hate halfway initialized structures, so from the	 * invariants perspective, this ub_dev is fully constructed at	 * this point.	 */	/*	 * This is needed to clear toggles. It is a problem only if we do	 * `rmmod ub && modprobe ub` without disconnects, but we like that.	 */	ub_probe_clear_stall(sc, sc->recv_bulk_pipe);	ub_probe_clear_stall(sc, sc->send_bulk_pipe);	/*	 * The way this is used by the startup code is a little specific.	 * A SCSI check causes a USB stall. Our common case code sees it	 * and clears the check, after which the device is ready for use.	 * But if a check was not present, any command other than	 * TEST_UNIT_READY ends with a lockup (including REQUEST_SENSE).	 *	 * If we neglect to clear the SCSI check, the first real command fails	 * (which is the capacity readout). We clear that and retry, but why	 * causing spurious retries for no reason.	 *	 * Revalidation may start with its own TEST_UNIT_READY, but that one	 * has to succeed, so we clear checks with an additional one here.	 * In any case it's not our business how revaliadation is implemented.	 */	for (i = 0; i < 3; i++) {	/* Retries for benh's key */		if ((rc = ub_sync_tur(sc, NULL)) <= 0) break;		if (rc != 0x6) break;		msleep(10);	}	nluns = 1;	for (i = 0; i < 3; i++) {		if ((rc = ub_sync_getmaxlun(sc)) < 0) {			/* 			 * Some devices (i.e. Iomega Zip100) need this --			 * apparently the bulk pipes get STALLed when the			 * GetMaxLUN request is processed.			 * XXX I have a ZIP-100, verify it does this.			 */			if (rc == -EPIPE) {				ub_probe_clear_stall(sc, sc->recv_bulk_pipe);				ub_probe_clear_stall(sc, sc->send_bulk_pipe);			}			break;		}		if (rc != 0) {			nluns = rc;			break;		}		mdelay(100);	}	for (i = 0; i < nluns; i++) {		ub_probe_lun(sc, i);	}	return 0;	/* device_remove_file(&sc->intf->dev, &dev_attr_diag); */err_diag:	usb_set_intfdata(intf, NULL);	// usb_put_intf(sc->intf);	usb_put_dev(sc->dev);	kfree(sc);err_core:	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/9f793d2c77ec5818679e4747c554d9333cecf476/ub.c/buggy/drivers/block/ub.c