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

Unverified Commit 416004a1 authored by Lucas Wei's avatar Lucas Wei Committed by Michael Bestas
Browse files

Revert "usb: dwc3: debugfs: Add and remove endpoint dirs dynamically"



This reverts commit 3bef2103.

Reason for revert: Boot fail with this patch.
Bug: 194984062
Signed-off-by: default avatarLucas Wei <lucaswei@google.com>
Change-Id: Ice1c308f6ff0255a5f541a6351ceebcda6b3ddca
parent 1b2abce0
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -711,12 +711,9 @@ void dwc3_dbg_dma_unmap(struct dwc3 *dwc, u8 ep_num,
			struct dwc3_request *req);

#ifdef CONFIG_DEBUG_FS
extern void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep);
extern void dwc3_debugfs_init(struct dwc3 *);
extern void dwc3_debugfs_exit(struct dwc3 *);
#else
static inline void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep)
{  }
static inline void dwc3_debugfs_init(struct dwc3 *d)
{  }
static inline void dwc3_debugfs_exit(struct dwc3 *d)
+19 −2
Original line number Diff line number Diff line
@@ -819,11 +819,12 @@ static void dwc3_debugfs_create_endpoint_files(struct dwc3_ep *dep,
	}
}

void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep)
static void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep,
		struct dentry *parent)
{
	struct dentry		*dir;

	dir = debugfs_create_dir(dep->name, dep->dwc->root);
	dir = debugfs_create_dir(dep->name, parent);
	if (!dir) {
		pr_err("%s: failed to create dir %s\n", __func__, dep->name);
		return;
@@ -832,6 +833,21 @@ void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep)
	dwc3_debugfs_create_endpoint_files(dep, dir);
}

static void dwc3_debugfs_create_endpoint_dirs(struct dwc3 *dwc,
		struct dentry *parent)
{
	int			i;

	for (i = 0; i < dwc->num_eps; i++) {
		struct dwc3_ep	*dep = dwc->eps[i];

		if (!dep)
			continue;

		dwc3_debugfs_create_endpoint_dir(dep, parent);
	}
}

static ssize_t dwc3_store_int_events(struct file *file,
			const char __user *ubuf, size_t count, loff_t *ppos)
{
@@ -1040,6 +1056,7 @@ void dwc3_debugfs_init(struct dwc3 *dwc)
				    &dwc3_testmode_fops);
		debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root, dwc,
				    &dwc3_link_state_fops);
		dwc3_debugfs_create_endpoint_dirs(dwc, root);

		file = debugfs_create_file("int_events", 0644, root, dwc,
				&dwc3_gadget_dbg_events_fops);
+0 −3
Original line number Diff line number Diff line
@@ -2963,8 +2963,6 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum)
	INIT_LIST_HEAD(&dep->started_list);
	INIT_LIST_HEAD(&dep->cancelled_list);

	dwc3_debugfs_create_endpoint_dir(dep);

	return 0;
}

@@ -3036,7 +3034,6 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
			list_del(&dep->endpoint.ep_list);
		}

		debugfs_remove_recursive(debugfs_lookup(dep->name, dwc->root));
		kfree(dep);
	}
}