/* module setup */ static int __init cu3088_init (void) { int rc; rc = device_register(&cu3088_root_dev); if (rc) return rc; rc = ccw_driver_register(&cu3088_driver); if (rc) device_unregister(&cu3088_root_dev); return rc; }
static int __init zfcp_module_init(void) { int retval = -ENOMEM; zfcp_fsf_qtcb_cache = zfcp_cache_hw_align("zfcp_fsf_qtcb", sizeof(struct fsf_qtcb)); if (!zfcp_fsf_qtcb_cache) goto out_qtcb_cache; zfcp_fc_req_cache = zfcp_cache_hw_align("zfcp_fc_req", sizeof(struct zfcp_fc_req)); if (!zfcp_fc_req_cache) goto out_fc_cache; zfcp_scsi_transport_template = fc_attach_transport(&zfcp_transport_functions); if (!zfcp_scsi_transport_template) goto out_transport; scsi_transport_reserve_device(zfcp_scsi_transport_template, sizeof(struct zfcp_scsi_dev)); retval = misc_register(&zfcp_cfdc_misc); if (retval) { pr_err("Registering the misc device zfcp_cfdc failed\n"); goto out_misc; } retval = ccw_driver_register(&zfcp_ccw_driver); if (retval) { pr_err("The zfcp device driver could not register with " "the common I/O layer\n"); goto out_ccw_register; } if (init_device) zfcp_init_device_setup(init_device); return 0; out_ccw_register: misc_deregister(&zfcp_cfdc_misc); out_misc: fc_release_transport(zfcp_scsi_transport_template); out_transport: kmem_cache_destroy(zfcp_fc_req_cache); out_fc_cache: kmem_cache_destroy(zfcp_fsf_qtcb_cache); out_qtcb_cache: return retval; }
/* module setup */ static int __init cu3088_init (void) { int rc; cu3088_root_dev = s390_root_dev_register("cu3088"); if (IS_ERR(cu3088_root_dev)) return PTR_ERR(cu3088_root_dev); rc = ccw_driver_register(&cu3088_driver); if (rc) s390_root_dev_unregister(cu3088_root_dev); return rc; }
/* * 3215 tty registration code called from tty_init(). * Most kernel services (incl. kmalloc) are available at this poimt. */ int __init tty3215_init(void) { struct tty_driver *driver; int ret; if (!CONSOLE_IS_3215) return 0; driver = alloc_tty_driver(NR_3215); if (!driver) return -ENOMEM; ret = ccw_driver_register(&raw3215_ccw_driver); if (ret) { put_tty_driver(driver); return ret; } /* * Initialize the tty_driver structure * Entries in tty3215_driver that are NOT initialized: * proc_entry, set_termios, flush_buffer, set_ldisc, write_proc */ driver->owner = THIS_MODULE; driver->driver_name = "tty3215"; driver->name = "ttyS"; driver->major = TTY_MAJOR; driver->minor_start = 64; driver->type = TTY_DRIVER_TYPE_SYSTEM; driver->subtype = SYSTEM_TYPE_TTY; driver->init_termios = tty_std_termios; driver->init_termios.c_iflag = IGNBRK | IGNPAR; driver->init_termios.c_oflag = ONLCR | XTABS; driver->init_termios.c_lflag = ISIG; driver->flags = TTY_DRIVER_REAL_RAW; tty_set_operations(driver, &tty3215_ops); ret = tty_register_driver(driver); if (ret) { printk("Couldn't register tty3215 driver\n"); put_tty_driver(driver); return ret; } tty3215_driver = driver; return 0; }
static int __init zfcp_module_init(void) { int retval = -ENOMEM; zfcp_data.gpn_ft_cache = zfcp_cache_hw_align("zfcp_gpn", sizeof(struct zfcp_fc_gpn_ft_req)); if (!zfcp_data.gpn_ft_cache) goto out; zfcp_data.qtcb_cache = zfcp_cache_hw_align("zfcp_qtcb", sizeof(struct fsf_qtcb)); if (!zfcp_data.qtcb_cache) goto out_qtcb_cache; zfcp_data.sr_buffer_cache = zfcp_cache_hw_align("zfcp_sr", sizeof(struct fsf_status_read_buffer)); if (!zfcp_data.sr_buffer_cache) goto out_sr_cache; zfcp_data.gid_pn_cache = zfcp_cache_hw_align("zfcp_gid", sizeof(struct zfcp_fc_gid_pn)); if (!zfcp_data.gid_pn_cache) goto out_gid_cache; zfcp_data.adisc_cache = zfcp_cache_hw_align("zfcp_adisc", sizeof(struct zfcp_fc_els_adisc)); if (!zfcp_data.adisc_cache) goto out_adisc_cache; zfcp_data.scsi_transport_template = fc_attach_transport(&zfcp_transport_functions); if (!zfcp_data.scsi_transport_template) goto out_transport; retval = misc_register(&zfcp_cfdc_misc); if (retval) { pr_err("Registering the misc device zfcp_cfdc failed\n"); goto out_misc; } retval = ccw_driver_register(&zfcp_ccw_driver); if (retval) { pr_err("The zfcp device driver could not register with " "the common I/O layer\n"); goto out_ccw_register; } if (init_device) zfcp_init_device_setup(init_device); return 0; out_ccw_register: misc_deregister(&zfcp_cfdc_misc); out_misc: fc_release_transport(zfcp_data.scsi_transport_template); out_transport: kmem_cache_destroy(zfcp_data.adisc_cache); out_adisc_cache: kmem_cache_destroy(zfcp_data.gid_pn_cache); out_gid_cache: kmem_cache_destroy(zfcp_data.sr_buffer_cache); out_sr_cache: kmem_cache_destroy(zfcp_data.qtcb_cache); out_qtcb_cache: kmem_cache_destroy(zfcp_data.gpn_ft_cache); out: return retval; }