static int __init cdrom_init(void) { int res = 0; TRACE_ENTRY(); cdrom_devtype.module = THIS_MODULE; res = scst_register_dev_driver(&cdrom_devtype); if (res < 0) goto out; #ifdef CONFIG_SCST_PROC res = scst_dev_handler_build_std_proc(&cdrom_devtype); if (res != 0) goto out_err; #endif out: TRACE_EXIT(); return res; #ifdef CONFIG_SCST_PROC out_err: scst_unregister_dev_driver(&cdrom_devtype); goto out; #endif }
static int __init init_scst_modisk_driver(void) { int res = 0; TRACE_ENTRY(); modisk_devtype.module = THIS_MODULE; res = scst_register_dev_driver(&modisk_devtype); if (res < 0) goto out; modisk_devtype_perf.module = THIS_MODULE; res = scst_register_dev_driver(&modisk_devtype_perf); if (res < 0) goto out_unreg; #ifdef CONFIG_SCST_PROC res = scst_dev_handler_build_std_proc(&modisk_devtype); if (res != 0) goto out_unreg1; res = scst_dev_handler_build_std_proc(&modisk_devtype_perf); if (res != 0) goto out_unreg2; #endif out: TRACE_EXIT_RES(res); return res; #ifdef CONFIG_SCST_PROC out_unreg2: scst_dev_handler_destroy_std_proc(&modisk_devtype); out_unreg1: scst_unregister_dev_driver(&modisk_devtype_perf); #endif out_unreg: scst_unregister_dev_driver(&modisk_devtype); goto out; }