void diagfwd_bridge_exit() { #ifdef USB_QCOM_DIAG_BRIDGE diag_hsic_exit(); diag_smux_exit(); #endif }
int diag_hsic_init() { int i; int err = 0; struct diag_hsic_info *ch = NULL; char wq_name[DIAG_HSIC_NAME_SZ + DIAG_HSIC_STRING_SZ]; for (i = 0; i < NUM_HSIC_DEV; i++) { ch = &diag_hsic[i]; spin_lock_init(&ch->lock); INIT_WORK(&(ch->read_work), hsic_read_work_fn); INIT_WORK(&(ch->open_work), hsic_open_work_fn); INIT_WORK(&(ch->close_work), hsic_close_work_fn); strlcpy(wq_name, "DIAG_HSIC_", DIAG_HSIC_STRING_SZ); strlcat(wq_name, ch->name, sizeof(ch->name)); ch->hsic_wq = create_singlethread_workqueue(wq_name); if (!ch->hsic_wq) goto fail; err = diagfwd_bridge_register(ch->dev_id, ch->id, &diag_hsic_fwd_ops); if (err) { pr_err("diag: Unable to register HSIC channel %d with bridge, err: %d\n", i, err); goto fail; } } err = platform_driver_register(&msm_hsic_ch_driver); if (err) { pr_err("diag: could not register HSIC device, err: %d\n", err); goto fail; } return 0; fail: diag_hsic_exit(); return -ENOMEM; }
void diagfwd_bridge_exit() { diag_hsic_exit(); diag_smux_exit(); }