 sprintf(buffer, "%d", privptr->buffer_size); DBF_TEXT(setup, 3, buffer); 
ctc_new_device(struct ccwgroup_device *cgdev){	char read_id[CTC_ID_SIZE];	char write_id[CTC_ID_SIZE];	int direction;	enum channel_types type;	struct ctc_priv *privptr;	struct net_device *dev;	int ret;	pr_debug("%s() called\n", __FUNCTION__);	DBF_TEXT(setup, 3, __FUNCTION__);	privptr = cgdev->dev.driver_data;	if (!privptr)		return -ENODEV;	type = get_channel_type(&cgdev->cdev[0]->id);		snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id);	snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id);	if (add_channel(cgdev->cdev[0], type))		return -ENOMEM;	if (add_channel(cgdev->cdev[1], type))		return -ENOMEM;	ret = ccw_device_set_online(cgdev->cdev[0]);	if (ret != 0) {			printk(KERN_WARNING		 	"ccw_device_set_online (cdev[0]) failed with ret = %d\n", ret);	}	ret = ccw_device_set_online(cgdev->cdev[1]);	if (ret != 0) {			printk(KERN_WARNING		 	"ccw_device_set_online (cdev[1]) failed with ret = %d\n", ret);	}	dev = ctc_init_netdevice(NULL, 1, privptr);	if (!dev) {		ctc_pr_warn("ctc_init_netdevice failed\n");		goto out;	}	if (privptr->protocol == CTC_PROTO_LINUX_TTY)		strlcpy(dev->name, "ctctty%d", IFNAMSIZ);	else		strlcpy(dev->name, "ctc%d", IFNAMSIZ);	for (direction = READ; direction <= WRITE; direction++) {		privptr->channel[direction] =		    channel_get(type, direction == READ ? read_id : write_id,				direction);		if (privptr->channel[direction] == NULL) {			if (direction == WRITE) 				channel_free(privptr->channel[READ]);			ctc_free_netdevice(dev, 1);			goto out;		}		privptr->channel[direction]->netdev = dev;		privptr->channel[direction]->protocol = privptr->protocol;		privptr->channel[direction]->max_bufsize = privptr->buffer_size;	}	/* sysfs magic */	SET_NETDEV_DEV(dev, &cgdev->dev);	if (ctc_netdev_register(dev) != 0) {		ctc_free_netdevice(dev, 1);		goto out;	}	ctc_add_attributes(&cgdev->dev);	strlcpy(privptr->fsm->name, dev->name, sizeof (privptr->fsm->name));	print_banner();	ctc_pr_info("%s: read: %s, write: %s, proto: %d\n",		    dev->name, privptr->channel[READ]->id,		    privptr->channel[WRITE]->id, privptr->protocol);	return 0;out:	ccw_device_set_offline(cgdev->cdev[1]);	ccw_device_set_offline(cgdev->cdev[0]);	return -ENODEV;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7394c928c849fe2ea5c20b6d73cbe7f220810d94/ctcmain.c/buggy/drivers/s390/net/ctcmain.c