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

Commit 673d5791 authored by Mao Jinlong's avatar Mao Jinlong
Browse files

byte-cntr: Support to enable byte-cntr after etr is enabled



There will be use case that enable byte-cntr after etr is enabled.
Make changes to support it.

Change-Id: Iec32a04e5377b901d7b92aa8b4e2731b75619e81
Signed-off-by: default avatarMao Jinlong <jinlmao@codeaurora.org>
parent cd914bbc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ static int tmc_etr_byte_cntr_open(struct inode *in, struct file *fp)

	mutex_lock(&byte_cntr_data->byte_cntr_lock);

	if (!byte_cntr_data->enable || !byte_cntr_data->block_size) {
	if (!tmcdrvdata->enable || !byte_cntr_data->block_size) {
		mutex_unlock(&byte_cntr_data->byte_cntr_lock);
		return -EINVAL;
	}
@@ -252,6 +252,7 @@ static int tmc_etr_byte_cntr_open(struct inode *in, struct file *fp)

	fp->private_data = byte_cntr_data;
	nonseekable_open(in, fp);
	byte_cntr_data->enable = true;
	byte_cntr_data->read_active = true;
	mutex_unlock(&byte_cntr_data->byte_cntr_lock);
	return 0;