*/
/* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_AUX_REVISION "$Revision: 1.108 $"
+#define ZFCP_AUX_REVISION "$Revision: 1.115 $"
#include "zfcp_ext.h"
/* written against the module interface */
static int __init zfcp_module_init(void);
-int zfcp_reboot_handler(struct notifier_block *, unsigned long, void *);
-
/* FCP related */
static void zfcp_ns_gid_pn_handler(unsigned long);
/* initialize adapters to be removed list head */
INIT_LIST_HEAD(&zfcp_data.adapter_remove_lh);
+ zfcp_transport_template = fc_attach_transport(&zfcp_transport_functions);
+ if (!zfcp_transport_template)
+ return -ENODEV;
+
#ifdef CONFIG_S390_SUPPORT
retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd,
zfcp_ioctl_trans.handler);
/* initialise configuration rw lock */
rwlock_init(&zfcp_data.config_lock);
- zfcp_data.reboot_notifier.notifier_call = zfcp_reboot_handler;
- register_reboot_notifier(&zfcp_data.reboot_notifier);
-
/* save address of data structure managing the driver module */
zfcp_data.scsi_host_template.module = THIS_MODULE;
goto out;
out_ccw_register:
- unregister_reboot_notifier(&zfcp_data.reboot_notifier);
misc_deregister(&zfcp_cfdc_misc);
out_misc_register:
#ifdef CONFIG_S390_SUPPORT
return retval;
}
-/*
- * This function is called automatically by the kernel whenever a reboot or a
- * shut-down is initiated and zfcp is still loaded
- *
- * locks: zfcp_data.config_sema is taken prior to shutting down the module
- * and removing all structures
- * returns: NOTIFY_DONE in all cases
- */
-int
-zfcp_reboot_handler(struct notifier_block *notifier, unsigned long code,
- void *ptr)
-{
- zfcp_ccw_unregister();
- return NOTIFY_DONE;
-}
-
-
/*
* function: zfcp_cfdc_dev_ioctl
*
retval = -ENOMEM;
goto out;
}
- sg_list->count = 0;
+ memset(sg_list, 0, sizeof(*sg_list));
if (command != ZFCP_CFDC_IOC) {
ZFCP_LOG_INFO("IOC request code 0x%x invalid\n", command);
sg_list->sg = kmalloc(sg_list->count * sizeof(struct scatterlist),
GFP_KERNEL);
if (sg_list->sg == NULL) {
+ sg_list->count = 0;
retval = -ENOMEM;
goto out;
}
unsigned int i;
int retval = 0;
- BUG_ON((sg_list->sg == NULL) || (sg_list == NULL));
+ BUG_ON(sg_list == NULL);
for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++)
__free_pages(sg->page, 0);
+ kfree(sg_list->sg);
+
return retval;
}