Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bbfb295 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: handle bam setup and cleanup for mbim in u_bam_dmux"

parents cd5e8123 85e28b13
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ static struct workqueue_struct *gbam_wq;
static unsigned int n_tx_req_queued;

static unsigned int bam_ch_ids[BAM_DMUX_NUM_FUNCS] = {
	BAM_DMUX_USB_RMNET_0,
	BAM_DMUX_USB_RMNET_0,
	BAM_DMUX_USB_DPL
};
@@ -1026,12 +1025,13 @@ static void gbam_port_free(enum bam_dmux_func_type func)
	struct gbam_port *port = bam_ports[func].port;
	struct platform_driver *pdrv = &bam_ports[func].pdrv;

	if (port)
	if (port) {
		platform_driver_unregister(pdrv);

		kfree(port);
		bam_ports[func].port = NULL;
	}
}

static int gbam_port_alloc(enum bam_dmux_func_type func)
{
@@ -1217,6 +1217,9 @@ static void gbam_debugfs_init(void)
}
static void gbam_debugfs_remove(void)
{
	if (!gbam_dent)
		return;

	debugfs_remove_recursive(gbam_dent);
	debugfs_remove(gbam_dent);
	gbam_dent = NULL;
@@ -1451,6 +1454,7 @@ int gbam_mbim_setup(void)
{
	int ret = 0;

	if (!bam_ports[BAM_DMUX_FUNC_RMNET].port)
		ret = gbam_setup(BAM_DMUX_FUNC_MBIM);

	return ret;
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@

enum bam_dmux_func_type {
	BAM_DMUX_FUNC_RMNET,
	BAM_DMUX_FUNC_MBIM,
	BAM_DMUX_FUNC_MBIM = 0,
	BAM_DMUX_FUNC_DPL,
	BAM_DMUX_NUM_FUNCS,
};