aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-01-09 07:50:21 -0500
committerStephen Boyd <sboyd@kernel.org>2019-02-22 13:01:21 -0500
commite7e6198c60566eda97655d495087fa73e1d7a1fd (patch)
tree9afe4f00aa1bce5205ce62f135cfc49c4ddf8200
parent8f99f5eab06cc837e196f87d4b1e1d14e5f1efe3 (diff)
clk: tegra: dfll: Fix debugfs_simple_attr.cocci warnings
Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
-rw-r--r--drivers/clk/tegra/clk-dfll.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c
index 609e363dabf8..7ec752ed3499 100644
--- a/drivers/clk/tegra/clk-dfll.c
+++ b/drivers/clk/tegra/clk-dfll.c
@@ -1112,8 +1112,8 @@ static int attr_enable_set(void *data, u64 val)
1112 1112
1113 return val ? dfll_enable(td) : dfll_disable(td); 1113 return val ? dfll_enable(td) : dfll_disable(td);
1114} 1114}
1115DEFINE_SIMPLE_ATTRIBUTE(enable_fops, attr_enable_get, attr_enable_set, 1115DEFINE_DEBUGFS_ATTRIBUTE(enable_fops, attr_enable_get, attr_enable_set,
1116 "%llu\n"); 1116 "%llu\n");
1117 1117
1118static int attr_lock_get(void *data, u64 *val) 1118static int attr_lock_get(void *data, u64 *val)
1119{ 1119{
@@ -1129,8 +1129,7 @@ static int attr_lock_set(void *data, u64 val)
1129 1129
1130 return val ? dfll_lock(td) : dfll_unlock(td); 1130 return val ? dfll_lock(td) : dfll_unlock(td);
1131} 1131}
1132DEFINE_SIMPLE_ATTRIBUTE(lock_fops, attr_lock_get, attr_lock_set, 1132DEFINE_DEBUGFS_ATTRIBUTE(lock_fops, attr_lock_get, attr_lock_set, "%llu\n");
1133 "%llu\n");
1134 1133
1135static int attr_rate_get(void *data, u64 *val) 1134static int attr_rate_get(void *data, u64 *val)
1136{ 1135{
@@ -1147,7 +1146,7 @@ static int attr_rate_set(void *data, u64 val)
1147 1146
1148 return dfll_request_rate(td, val); 1147 return dfll_request_rate(td, val);
1149} 1148}
1150DEFINE_SIMPLE_ATTRIBUTE(rate_fops, attr_rate_get, attr_rate_set, "%llu\n"); 1149DEFINE_DEBUGFS_ATTRIBUTE(rate_fops, attr_rate_get, attr_rate_set, "%llu\n");
1151 1150
1152static int attr_registers_show(struct seq_file *s, void *data) 1151static int attr_registers_show(struct seq_file *s, void *data)
1153{ 1152{
@@ -1196,10 +1195,11 @@ static void dfll_debug_init(struct tegra_dfll *td)
1196 root = debugfs_create_dir("tegra_dfll_fcpu", NULL); 1195 root = debugfs_create_dir("tegra_dfll_fcpu", NULL);
1197 td->debugfs_dir = root; 1196 td->debugfs_dir = root;
1198 1197
1199 debugfs_create_file("enable", S_IRUGO | S_IWUSR, root, td, &enable_fops); 1198 debugfs_create_file_unsafe("enable", 0644, root, td,
1200 debugfs_create_file("lock", S_IRUGO, root, td, &lock_fops); 1199 &enable_fops);
1201 debugfs_create_file("rate", S_IRUGO, root, td, &rate_fops); 1200 debugfs_create_file_unsafe("lock", 0444, root, td, &lock_fops);
1202 debugfs_create_file("registers", S_IRUGO, root, td, &attr_registers_fops); 1201 debugfs_create_file_unsafe("rate", 0444, root, td, &rate_fops);
1202 debugfs_create_file("registers", 0444, root, td, &attr_registers_fops);
1203} 1203}
1204 1204
1205#else 1205#else