@@ -35,7 +35,7 @@ void opp_debug_remove_one(struct dev_pm_opp *opp)
35
35
debugfs_remove_recursive (opp -> dentry );
36
36
}
37
37
38
- static bool opp_debug_create_supplies (struct dev_pm_opp * opp ,
38
+ static void opp_debug_create_supplies (struct dev_pm_opp * opp ,
39
39
struct opp_table * opp_table ,
40
40
struct dentry * pdentry )
41
41
{
@@ -50,30 +50,21 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp,
50
50
/* Create per-opp directory */
51
51
d = debugfs_create_dir (name , pdentry );
52
52
53
- if (! d )
54
- return false ;
53
+ debugfs_create_ulong ( "u_volt_target" , S_IRUGO , d ,
54
+ & opp -> supplies [ i ]. u_volt ) ;
55
55
56
- if (!debugfs_create_ulong ("u_volt_target" , S_IRUGO , d ,
57
- & opp -> supplies [i ].u_volt ))
58
- return false;
56
+ debugfs_create_ulong ("u_volt_min" , S_IRUGO , d ,
57
+ & opp -> supplies [i ].u_volt_min );
59
58
60
- if (!debugfs_create_ulong ("u_volt_min" , S_IRUGO , d ,
61
- & opp -> supplies [i ].u_volt_min ))
62
- return false;
59
+ debugfs_create_ulong ("u_volt_max" , S_IRUGO , d ,
60
+ & opp -> supplies [i ].u_volt_max );
63
61
64
- if (!debugfs_create_ulong ("u_volt_max" , S_IRUGO , d ,
65
- & opp -> supplies [i ].u_volt_max ))
66
- return false;
67
-
68
- if (!debugfs_create_ulong ("u_amp" , S_IRUGO , d ,
69
- & opp -> supplies [i ].u_amp ))
70
- return false;
62
+ debugfs_create_ulong ("u_amp" , S_IRUGO , d ,
63
+ & opp -> supplies [i ].u_amp );
71
64
}
72
-
73
- return true;
74
65
}
75
66
76
- int opp_debug_create_one (struct dev_pm_opp * opp , struct opp_table * opp_table )
67
+ void opp_debug_create_one (struct dev_pm_opp * opp , struct opp_table * opp_table )
77
68
{
78
69
struct dentry * pdentry = opp_table -> dentry ;
79
70
struct dentry * d ;
@@ -95,40 +86,23 @@ int opp_debug_create_one(struct dev_pm_opp *opp, struct opp_table *opp_table)
95
86
96
87
/* Create per-opp directory */
97
88
d = debugfs_create_dir (name , pdentry );
98
- if (!d )
99
- return - ENOMEM ;
100
-
101
- if (!debugfs_create_bool ("available" , S_IRUGO , d , & opp -> available ))
102
- return - ENOMEM ;
103
-
104
- if (!debugfs_create_bool ("dynamic" , S_IRUGO , d , & opp -> dynamic ))
105
- return - ENOMEM ;
106
-
107
- if (!debugfs_create_bool ("turbo" , S_IRUGO , d , & opp -> turbo ))
108
- return - ENOMEM ;
109
-
110
- if (!debugfs_create_bool ("suspend" , S_IRUGO , d , & opp -> suspend ))
111
- return - ENOMEM ;
112
-
113
- if (!debugfs_create_u32 ("performance_state" , S_IRUGO , d , & opp -> pstate ))
114
- return - ENOMEM ;
115
89
116
- if (!debugfs_create_ulong ("rate_hz" , S_IRUGO , d , & opp -> rate ))
117
- return - ENOMEM ;
90
+ debugfs_create_bool ("available" , S_IRUGO , d , & opp -> available );
91
+ debugfs_create_bool ("dynamic" , S_IRUGO , d , & opp -> dynamic );
92
+ debugfs_create_bool ("turbo" , S_IRUGO , d , & opp -> turbo );
93
+ debugfs_create_bool ("suspend" , S_IRUGO , d , & opp -> suspend );
94
+ debugfs_create_u32 ("performance_state" , S_IRUGO , d , & opp -> pstate );
95
+ debugfs_create_ulong ("rate_hz" , S_IRUGO , d , & opp -> rate );
96
+ debugfs_create_ulong ("clock_latency_ns" , S_IRUGO , d ,
97
+ & opp -> clock_latency_ns );
118
98
119
- if (!opp_debug_create_supplies (opp , opp_table , d ))
120
- return - ENOMEM ;
121
-
122
- if (!debugfs_create_ulong ("clock_latency_ns" , S_IRUGO , d ,
123
- & opp -> clock_latency_ns ))
124
- return - ENOMEM ;
99
+ opp_debug_create_supplies (opp , opp_table , d );
125
100
126
101
opp -> dentry = d ;
127
- return 0 ;
128
102
}
129
103
130
- static int opp_list_debug_create_dir (struct opp_device * opp_dev ,
131
- struct opp_table * opp_table )
104
+ static void opp_list_debug_create_dir (struct opp_device * opp_dev ,
105
+ struct opp_table * opp_table )
132
106
{
133
107
const struct device * dev = opp_dev -> dev ;
134
108
struct dentry * d ;
@@ -137,36 +111,21 @@ static int opp_list_debug_create_dir(struct opp_device *opp_dev,
137
111
138
112
/* Create device specific directory */
139
113
d = debugfs_create_dir (opp_table -> dentry_name , rootdir );
140
- if (!d ) {
141
- dev_err (dev , "%s: Failed to create debugfs dir\n" , __func__ );
142
- return - ENOMEM ;
143
- }
144
114
145
115
opp_dev -> dentry = d ;
146
116
opp_table -> dentry = d ;
147
-
148
- return 0 ;
149
117
}
150
118
151
- static int opp_list_debug_create_link (struct opp_device * opp_dev ,
152
- struct opp_table * opp_table )
119
+ static void opp_list_debug_create_link (struct opp_device * opp_dev ,
120
+ struct opp_table * opp_table )
153
121
{
154
- const struct device * dev = opp_dev -> dev ;
155
122
char name [NAME_MAX ];
156
- struct dentry * d ;
157
123
158
124
opp_set_dev_name (opp_dev -> dev , name );
159
125
160
126
/* Create device specific directory link */
161
- d = debugfs_create_symlink (name , rootdir , opp_table -> dentry_name );
162
- if (!d ) {
163
- dev_err (dev , "%s: Failed to create link\n" , __func__ );
164
- return - ENOMEM ;
165
- }
166
-
167
- opp_dev -> dentry = d ;
168
-
169
- return 0 ;
127
+ opp_dev -> dentry = debugfs_create_symlink (name , rootdir ,
128
+ opp_table -> dentry_name );
170
129
}
171
130
172
131
/**
@@ -177,20 +136,13 @@ static int opp_list_debug_create_link(struct opp_device *opp_dev,
177
136
* Dynamically adds device specific directory in debugfs 'opp' directory. If the
178
137
* device-opp is shared with other devices, then links will be created for all
179
138
* devices except the first.
180
- *
181
- * Return: 0 on success, otherwise negative error.
182
139
*/
183
- int opp_debug_register (struct opp_device * opp_dev , struct opp_table * opp_table )
140
+ void opp_debug_register (struct opp_device * opp_dev , struct opp_table * opp_table )
184
141
{
185
- if (!rootdir ) {
186
- pr_debug ("%s: Uninitialized rootdir\n" , __func__ );
187
- return - EINVAL ;
188
- }
189
-
190
142
if (opp_table -> dentry )
191
- return opp_list_debug_create_link (opp_dev , opp_table );
192
-
193
- return opp_list_debug_create_dir (opp_dev , opp_table );
143
+ opp_list_debug_create_link (opp_dev , opp_table );
144
+ else
145
+ opp_list_debug_create_dir (opp_dev , opp_table );
194
146
}
195
147
196
148
static void opp_migrate_dentry (struct opp_device * opp_dev ,
@@ -252,10 +204,6 @@ static int __init opp_debug_init(void)
252
204
{
253
205
/* Create /sys/kernel/debug/opp directory */
254
206
rootdir = debugfs_create_dir ("opp" , NULL );
255
- if (!rootdir ) {
256
- pr_err ("%s: Failed to create root directory\n" , __func__ );
257
- return - ENOMEM ;
258
- }
259
207
260
208
return 0 ;
261
209
}
0 commit comments