class_simple_destroy(tape_class); 
class_destroy(tape_class); 
int __init viotap_init(void){	int ret;	struct proc_dir_entry *e;	op_struct_list = NULL;	if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) {		printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n");		return ret;	}	spin_lock_init(&op_struct_list_lock);	sema_init(&reqSem, VIOTAPE_MAXREQ);	if (viopath_hostLp == HvLpIndexInvalid) {		vio_set_hostlp();		if (viopath_hostLp == HvLpIndexInvalid) {			ret = -ENODEV;			goto clear_op;		}	}	ret = viopath_open(viopath_hostLp, viomajorsubtype_tape,			VIOTAPE_MAXREQ + 2);	if (ret) {		printk(VIOTAPE_KERN_WARN				"error on viopath_open to hostlp %d\n", ret);		ret = -EIO;		goto clear_op;	}	printk(VIOTAPE_KERN_INFO "vers " VIOTAPE_VERSION			", hosting partition %d\n", viopath_hostLp);	vio_setHandler(viomajorsubtype_tape, vioHandleTapeEvent);	ret = register_chrdev(VIOTAPE_MAJOR, "viotape", &viotap_fops);	if (ret < 0) {		printk(VIOTAPE_KERN_WARN "Error registering viotape device\n");		goto clear_handler;	}	tape_class = class_simple_create(THIS_MODULE, "tape");	if (IS_ERR(tape_class)) {		printk(VIOTAPE_KERN_WARN "Unable to allocat class\n");		ret = PTR_ERR(tape_class);		goto unreg_chrdev;	}	if ((ret = get_viotape_info()) < 0) {		printk(VIOTAPE_KERN_WARN "Unable to obtain virtual device information");		goto unreg_class;	}	ret = vio_register_driver(&viotape_driver);	if (ret)		goto unreg_class;	e = create_proc_entry("iSeries/viotape", S_IFREG|S_IRUGO, NULL);	if (e) {		e->owner = THIS_MODULE;		e->proc_fops = &proc_viotape_operations;	}	return 0;unreg_class:	class_simple_destroy(tape_class);unreg_chrdev:	unregister_chrdev(VIOTAPE_MAJOR, "viotape");clear_handler:	vio_clearHandler(viomajorsubtype_tape);	viopath_close(viopath_hostLp, viomajorsubtype_tape, VIOTAPE_MAXREQ + 2);clear_op:	clear_op_struct_pool();	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ca8eca6884861c1ce294b05aacfdf9045bba9aff/viotape.c/buggy/drivers/char/viotape.c