diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index 14629fbe..a5267eac 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | |||
@@ -35,6 +35,7 @@ | |||
35 | the resolution of ptimer. */ | 35 | the resolution of ptimer. */ |
36 | #define PTIMER_REF_FREQ_HZ 31250000 | 36 | #define PTIMER_REF_FREQ_HZ 31250000 |
37 | 37 | ||
38 | #define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH) | ||
38 | 39 | ||
39 | static ssize_t elcg_enable_store(struct device *device, | 40 | static ssize_t elcg_enable_store(struct device *device, |
40 | struct device_attribute *attr, const char *buf, size_t count) | 41 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -73,7 +74,7 @@ static ssize_t elcg_enable_read(struct device *device, | |||
73 | return sprintf(buf, "%d\n", g->elcg_enabled ? 1 : 0); | 74 | return sprintf(buf, "%d\n", g->elcg_enabled ? 1 : 0); |
74 | } | 75 | } |
75 | 76 | ||
76 | static DEVICE_ATTR(elcg_enable, S_IRWXUGO, elcg_enable_read, elcg_enable_store); | 77 | static DEVICE_ATTR(elcg_enable, ROOTRW, elcg_enable_read, elcg_enable_store); |
77 | 78 | ||
78 | static ssize_t blcg_enable_store(struct device *device, | 79 | static ssize_t blcg_enable_store(struct device *device, |
79 | struct device_attribute *attr, const char *buf, size_t count) | 80 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -109,7 +110,8 @@ static ssize_t blcg_enable_read(struct device *device, | |||
109 | return sprintf(buf, "%d\n", g->blcg_enabled ? 1 : 0); | 110 | return sprintf(buf, "%d\n", g->blcg_enabled ? 1 : 0); |
110 | } | 111 | } |
111 | 112 | ||
112 | static DEVICE_ATTR(blcg_enable, S_IRWXUGO, blcg_enable_read, blcg_enable_store); | 113 | |
114 | static DEVICE_ATTR(blcg_enable, ROOTRW, blcg_enable_read, blcg_enable_store); | ||
113 | 115 | ||
114 | static ssize_t slcg_enable_store(struct device *device, | 116 | static ssize_t slcg_enable_store(struct device *device, |
115 | struct device_attribute *attr, const char *buf, size_t count) | 117 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -151,7 +153,7 @@ static ssize_t slcg_enable_read(struct device *device, | |||
151 | return sprintf(buf, "%d\n", g->slcg_enabled ? 1 : 0); | 153 | return sprintf(buf, "%d\n", g->slcg_enabled ? 1 : 0); |
152 | } | 154 | } |
153 | 155 | ||
154 | static DEVICE_ATTR(slcg_enable, S_IRWXUGO, slcg_enable_read, slcg_enable_store); | 156 | static DEVICE_ATTR(slcg_enable, ROOTRW, slcg_enable_read, slcg_enable_store); |
155 | 157 | ||
156 | static ssize_t ptimer_scale_factor_show(struct device *dev, | 158 | static ssize_t ptimer_scale_factor_show(struct device *dev, |
157 | struct device_attribute *attr, | 159 | struct device_attribute *attr, |
@@ -203,7 +205,7 @@ static ssize_t railgate_delay_show(struct device *dev, | |||
203 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 205 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
204 | return snprintf(buf, PAGE_SIZE, "%d\n", platform->railgate_delay); | 206 | return snprintf(buf, PAGE_SIZE, "%d\n", platform->railgate_delay); |
205 | } | 207 | } |
206 | static DEVICE_ATTR(railgate_delay, S_IRWXUGO, railgate_delay_show, | 208 | static DEVICE_ATTR(railgate_delay, ROOTRW, railgate_delay_show, |
207 | railgate_delay_store); | 209 | railgate_delay_store); |
208 | 210 | ||
209 | static ssize_t clockgate_delay_store(struct device *dev, | 211 | static ssize_t clockgate_delay_store(struct device *dev, |
@@ -229,7 +231,7 @@ static ssize_t clockgate_delay_show(struct device *dev, | |||
229 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 231 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
230 | return snprintf(buf, PAGE_SIZE, "%d\n", platform->clockgate_delay); | 232 | return snprintf(buf, PAGE_SIZE, "%d\n", platform->clockgate_delay); |
231 | } | 233 | } |
232 | static DEVICE_ATTR(clockgate_delay, S_IRWXUGO, clockgate_delay_show, | 234 | static DEVICE_ATTR(clockgate_delay, ROOTRW, clockgate_delay_show, |
233 | clockgate_delay_store); | 235 | clockgate_delay_store); |
234 | 236 | ||
235 | static ssize_t counters_show(struct device *dev, | 237 | static ssize_t counters_show(struct device *dev, |
@@ -305,7 +307,7 @@ static ssize_t elpg_enable_read(struct device *device, | |||
305 | return sprintf(buf, "%d\n", g->elpg_enabled ? 1 : 0); | 307 | return sprintf(buf, "%d\n", g->elpg_enabled ? 1 : 0); |
306 | } | 308 | } |
307 | 309 | ||
308 | static DEVICE_ATTR(elpg_enable, S_IRWXUGO, elpg_enable_read, elpg_enable_store); | 310 | static DEVICE_ATTR(elpg_enable, ROOTRW, elpg_enable_read, elpg_enable_store); |
309 | 311 | ||
310 | void gk20a_remove_sysfs(struct device *dev) | 312 | void gk20a_remove_sysfs(struct device *dev) |
311 | { | 313 | { |