z90_unregister_ioctl32s();  
z90crypt_init_module(void){	int result, nresult;	struct proc_dir_entry *entry;	PDEBUG("PID %d\n", PID());	if ((domain < -1) || (domain > 15)) {		PRINTKW("Invalid param: domain = %d.  Not loading.\n", domain);		return -EINVAL;	}#ifndef Z90CRYPT_USE_HOTPLUG	/* Register as misc device with given minor (or get a dynamic one). */	result = misc_register(&z90crypt_misc_device);	if (result < 0) {		PRINTKW(KERN_ERR "misc_register (minor %d) failed with %d\n",			z90crypt_misc_device.minor, result);		return result;	}#else	/* Register the major (or get a dynamic one). */	result = register_chrdev(z90crypt_major, REG_NAME, &z90crypt_fops);	if (result < 0) {		PRINTKW("register_chrdev (major %d) failed with %d.\n",			z90crypt_major, result);		return result;	}	if (z90crypt_major == 0)		z90crypt_major = result;#endif	PDEBUG("Registered " DEV_NAME " with result %d\n", result);	result = create_z90crypt(&domain);	if (result != 0) {		PRINTKW("create_z90crypt (domain index %d) failed with %d.\n",			domain, result);		result = -ENOMEM;		goto init_module_cleanup;	}	if (result == 0) {		PRINTKN("Version %d.%d.%d loaded, built on %s %s\n",			z90crypt_VERSION, z90crypt_RELEASE, z90crypt_VARIANT,			__DATE__, __TIME__);		PRINTKN("%s\n", z90main_version);		PRINTKN("%s\n", z90hardware_version);		PDEBUG("create_z90crypt (domain index %d) successful.\n",		       domain);	} else		PRINTK("No devices at startup\n");#ifdef Z90CRYPT_USE_HOTPLUG	/* generate hotplug event for device node generation */	z90crypt_hotplug_event(z90crypt_major, 0, Z90CRYPT_HOTPLUG_ADD);#endif	/* Initialize globals. */	spin_lock_init(&queuespinlock);	INIT_LIST_HEAD(&pending_list);	pendingq_count = 0;	INIT_LIST_HEAD(&request_list);	requestq_count = 0;	quiesce_z90crypt = 0;	atomic_set(&total_open, 0);	atomic_set(&z90crypt_step, 0);	/* Set up the cleanup task. */	init_timer(&cleanup_timer);	cleanup_timer.function = z90crypt_cleanup_task;	cleanup_timer.data = 0;	cleanup_timer.expires = jiffies + (CLEANUPTIME * HZ);	add_timer(&cleanup_timer);	/* Set up the proc file system */	entry = create_proc_entry("driver/z90crypt", 0644, 0);	if (entry) {		entry->nlink = 1;		entry->data = 0;		entry->read_proc = z90crypt_status;		entry->write_proc = z90crypt_status_write;	}	else		PRINTK("Couldn't create z90crypt proc entry\n");	z90crypt_entry = entry;	/* Set up the configuration task. */	init_timer(&config_timer);	config_timer.function = z90crypt_config_task;	config_timer.data = 0;	config_timer.expires = jiffies + (INITIAL_CONFIGTIME * HZ);	add_timer(&config_timer);	/* Set up the reader task */	tasklet_init(&reader_tasklet, z90crypt_reader_task, 0);	init_timer(&reader_timer);	reader_timer.function = z90crypt_schedule_reader_task;	reader_timer.data = 0;	reader_timer.expires = jiffies + (READERTIME * HZ / 1000);	add_timer(&reader_timer);	if ((result = z90_register_ioctl32s()))		goto init_module_cleanup;	return 0; // successinit_module_cleanup:	z90_unregister_ioctl32s();#ifndef Z90CRYPT_USE_HOTPLUG	if ((nresult = misc_deregister(&z90crypt_misc_device)))		PRINTK("misc_deregister failed with %d.\n", nresult);	else		PDEBUG("misc_deregister successful.\n");#else	if ((nresult = unregister_chrdev(z90crypt_major, REG_NAME)))		PRINTK("unregister_chrdev failed with %d.\n", nresult);	else		PDEBUG("unregister_chrdev successful.\n");#endif	return result; // failure}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/af6c8eed14a0c14791e2fbb4c7726755c1a637ca/z90main.c/buggy/drivers/s390/crypto/z90main.c