int ds_probe(struct usb_interface *intf, const struct usb_device_id *udev_id) 
static int ds_probe(struct usb_interface *intf, const struct usb_device_id *udev_id) 
int ds_probe(struct usb_interface *intf, const struct usb_device_id *udev_id){	struct usb_device *udev = interface_to_usbdev(intf);	struct usb_endpoint_descriptor *endpoint;	struct usb_host_interface *iface_desc;	int i, err;	ds_dev = kmalloc(sizeof(struct ds_device), GFP_KERNEL);	if (!ds_dev) {		printk(KERN_INFO "Failed to allocate new DS9490R structure.\n");		return -ENOMEM;	}	ds_dev->udev = usb_get_dev(udev);	usb_set_intfdata(intf, ds_dev);	err = usb_set_interface(ds_dev->udev, intf->altsetting[0].desc.bInterfaceNumber, 3);	if (err) {		printk(KERN_ERR "Failed to set alternative setting 3 for %d interface: err=%d.\n",				intf->altsetting[0].desc.bInterfaceNumber, err);		return err;	}	err = usb_reset_configuration(ds_dev->udev);	if (err) {		printk(KERN_ERR "Failed to reset configuration: err=%d.\n", err);		return err;	}		iface_desc = &intf->altsetting[0];	if (iface_desc->desc.bNumEndpoints != NUM_EP-1) {		printk(KERN_INFO "Num endpoints=%d. It is not DS9490R.\n", iface_desc->desc.bNumEndpoints);		return -ENODEV;	}	atomic_set(&ds_dev->refcnt, 0);	memset(ds_dev->ep, 0, sizeof(ds_dev->ep));		/*	 * This loop doesn'd show control 0 endpoint, 	 * so we will fill only 1-3 endpoints entry.	 */	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {		endpoint = &iface_desc->endpoint[i].desc;		ds_dev->ep[i+1] = endpoint->bEndpointAddress;				printk("%d: addr=%x, size=%d, dir=%s, type=%x\n",			i, endpoint->bEndpointAddress, le16_to_cpu(endpoint->wMaxPacketSize),			(endpoint->bEndpointAddress & USB_DIR_IN)?"IN":"OUT",			endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK);	}	#if 0	{		int err, i;		u64 buf[3];		u64 init=0xb30000002078ee81ull;		struct ds_status st;				ds_reset(ds_dev, &st);		err = ds_search(ds_dev, init, buf, 3, 0);		if (err < 0)			return err;		for (i=0; i<err; ++i)			printk("%d: %llx\n", i, buf[i]);				printk("Resetting...\n");			ds_reset(ds_dev, &st);		printk("Setting path for %llx.\n", init);		err = ds_set_path(ds_dev, init);		if (err)			return err;		printk("Calling MATCH_ACCESS.\n");		err = ds_match_access(ds_dev, init);		if (err)			return err;		printk("Searching the bus...\n");		err = ds_search(ds_dev, init, buf, 3, 0);		printk("ds_search() returned %d\n", err);				if (err < 0)			return err;		for (i=0; i<err; ++i)			printk("%d: %llx\n", i, buf[i]);				return 0;	}#endif	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8949d2aa05ddf5e9a31d738568a79915970cb38e/dscore.c/clean/drivers/w1/dscore.c