static int __init chp_init(void) { struct chp_id chpid; int ret; ret = crw_register_handler(CRW_RSC_CPATH, chp_process_crw); if (ret) return ret; chp_wq = create_singlethread_workqueue("cio_chp"); if (!chp_wq) { crw_unregister_handler(CRW_RSC_CPATH); return -ENOMEM; } INIT_WORK(&cfg_work, cfg_func); init_waitqueue_head(&cfg_wait_queue); if (info_update()) return 0; /* Register available channel-paths. */ chp_id_for_each(&chpid) { if (chp_info_get_status(chpid) != CHP_STATUS_NOT_RECOGNIZED) chp_new(chpid); } return 0; }
static ssize_t chp_configure_show(struct device *dev, struct device_attribute *attr, char *buf) { struct channel_path *cp; int status; cp = to_channelpath(dev); status = chp_info_get_status(cp->chpid); if (status < 0) return status; return snprintf(buf, PAGE_SIZE, "%d\n", status); }
static int __init chp_init(void) { struct chp_id chpid; chp_wq = create_singlethread_workqueue("cio_chp"); if (!chp_wq) return -ENOMEM; INIT_WORK(&cfg_work, cfg_func, NULL); init_waitqueue_head(&cfg_wait_queue); if (info_update()) return 0; /* Register available channel-paths. */ chp_id_for_each(&chpid) { if (chp_info_get_status(chpid) != CHP_STATUS_NOT_RECOGNIZED) chp_new(chpid); } return 0; }