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

Commit c2e5e5e9 authored by Yue Ma's avatar Yue Ma Committed by Gerrit - the friendly Code Review server
Browse files

cnss2: Fix minor issues related to runtime PM debugfs interface



pm_runtime_*() APIs may return positive number if device is already
active. Currently the positive number will be returned to upper layer
which will be considered a valid read count. If the number returned
is less then the command size, the rest of command will be re-parsed
again which results invalid command being printed which is confusing.
Hence only return it if it is a negative error code, otherwise just
return read count. Fix another place which may run into the same
situation. Also add missing info for runtime PM debugfs interface.

Change-Id: I7c53dc2cbe15164da816a479c77a202a3dfc4f93
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent b5b2baf0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ static ssize_t cnss_dev_boot_debug_write(struct file *fp,
		ret = -EINVAL;
	}

	if (ret)
	if (ret < 0)
		return ret;

	return count;
@@ -482,7 +482,7 @@ static ssize_t cnss_runtime_pm_debug_write(struct file *fp,
		ret = -EINVAL;
	}

	if (ret)
	if (ret < 0)
		return ret;

	return count;
@@ -493,6 +493,8 @@ static int cnss_runtime_pm_debug_show(struct seq_file *s, void *data)
	seq_puts(s, "\nUsage: echo <action> > <debugfs_path>/cnss/runtime_pm\n");
	seq_puts(s, "<action> can be one of below:\n");
	seq_puts(s, "usage_count: get runtime PM usage count\n");
	seq_puts(s, "reques_resume: do async runtime PM resume\n");
	seq_puts(s, "resume: do sync runtime PM resume\n");
	seq_puts(s, "get: do runtime PM get\n");
	seq_puts(s, "get_noresume: do runtime PM get noresume\n");
	seq_puts(s, "put_noidle: do runtime PM put noidle\n");