kernels/linux-2.4.0/drivers/usb/serial/belkin_sa.c
/* do some startup allocations not currently performed by usb_serial_probe() */
do some startup allocations not currently performed by usb_serial_probe()
do some startup allocations not currently performed by usb_serial_probe ()
static int belkin_sa_startup (struct usb_serial *serial)
{
	struct usb_device *dev = serial->dev;
	struct belkin_sa_private *priv;
	serial->port->private = kmalloc(sizeof(struct belkin_sa_private), GFP_KERNEL);
	if (!serial->port->private)
		return (-1); 
	priv = (struct belkin_sa_private *)serial->port->private;
	priv->control_state = 0;
	priv->last_lsr = 0;
	priv->last_msr = 0;
	priv->bad_flow_control = (dev->descriptor.bcdDevice <= 0x0206) ? 1 : 0;
	info("bcdDevice: %04x, bfc: %d", dev->descriptor.bcdDevice, priv->bad_flow_control);
	init_waitqueue_head(&serial->port->write_wait);
	return (0);
}
static int belkin_sa_startup ( struct usb_serial * serial ) { struct usb_device * dev = serial -> dev ; struct belkin_sa_private * priv ; serial -> port -> private = kmalloc ( sizeof ( struct belkin_sa_private ) , GFP_KERNEL ) ; if ( ! serial -> port -> private ) return ( -1 ) ; priv = ( struct belkin_sa_private * ) serial -> port -> private ; priv -> control_state = 0 ; priv -> last_lsr = 0 ; priv -> last_msr = 0 ; priv -> bad_flow_control = ( dev -> descriptor . bcdDevice <= 0x0206 ) ? 1 : 0 ; info ( " " , dev -> descriptor . bcdDevice , priv -> bad_flow_control ) ; init_waitqueue_head ( & serial -> port -> write_wait ) ; return ( 0 ) ; }
do some startup allocations not currently performed by usb_serial_probe()
do some startup allocations not currently performed by usb_serial_probe ()
/* allocate the private data structure */ /* error */ /* set initial values for control structures */ /* see comments at top of file */