void diagfwd_bridge_exit()
{
	#ifdef USB_QCOM_DIAG_BRIDGE
	diag_hsic_exit();
	diag_smux_exit();
	#endif
}
int diag_smux_init()
{
	int i;
	int err = 0;
	struct diag_smux_info *ch = NULL;
	char wq_name[DIAG_SMUX_NAME_SZ + 11];

	for (i = 0; i < NUM_SMUX_DEV; i++) {
		ch = &diag_smux[i];
		strlcpy(wq_name, "DIAG_SMUX_", 11);
		strlcat(wq_name, ch->name, sizeof(ch->name));
		ch->smux_wq = create_singlethread_workqueue(wq_name);
		if (!ch->smux_wq) {
			err = -ENOMEM;
			goto fail;
		}
		err = diagfwd_bridge_register(ch->dev_id, ch->id,
					      &diag_smux_fwd_ops);
		if (err) {
			pr_err("diag: Unable to register SMUX ch %d with bridge\n",
			       ch->id);
			goto fail;
		}
	}

	err = platform_driver_register(&msm_diagfwd_smux_driver);
	if (err) {
		pr_err("diag: Unable to register SMUX device, err: %d\n", err);
		goto fail;
	}

	return 0;
fail:
	diag_smux_exit();
	return err;
}
Esempio n. 3
0
void diagfwd_bridge_exit()
{
	diag_hsic_exit();
	diag_smux_exit();
}