@@ -163,46 +163,30 @@ static const struct file_operations lowpan_ctx_pfx_fops = {
163163 .release = single_release ,
164164};
165165
166- static int lowpan_dev_debugfs_ctx_init (struct net_device * dev ,
167- struct dentry * ctx , u8 id )
166+ static void lowpan_dev_debugfs_ctx_init (struct net_device * dev ,
167+ struct dentry * ctx , u8 id )
168168{
169169 struct lowpan_dev * ldev = lowpan_dev (dev );
170- struct dentry * dentry , * root ;
170+ struct dentry * root ;
171171 char buf [32 ];
172172
173173 WARN_ON_ONCE (id > LOWPAN_IPHC_CTX_TABLE_SIZE );
174174
175175 sprintf (buf , "%d" , id );
176176
177177 root = debugfs_create_dir (buf , ctx );
178- if (!root )
179- return - EINVAL ;
180178
181- dentry = debugfs_create_file_unsafe ("active" , 0644 , root ,
182- & ldev -> ctx .table [id ],
183- & lowpan_ctx_flag_active_fops );
184- if (!dentry )
185- return - EINVAL ;
179+ debugfs_create_file ("active" , 0644 , root , & ldev -> ctx .table [id ],
180+ & lowpan_ctx_flag_active_fops );
186181
187- dentry = debugfs_create_file_unsafe ("compression" , 0644 , root ,
188- & ldev -> ctx .table [id ],
189- & lowpan_ctx_flag_c_fops );
190- if (!dentry )
191- return - EINVAL ;
192-
193- dentry = debugfs_create_file ("prefix" , 0644 , root ,
194- & ldev -> ctx .table [id ],
195- & lowpan_ctx_pfx_fops );
196- if (!dentry )
197- return - EINVAL ;
182+ debugfs_create_file ("compression" , 0644 , root , & ldev -> ctx .table [id ],
183+ & lowpan_ctx_flag_c_fops );
198184
199- dentry = debugfs_create_file_unsafe ("prefix_len" , 0644 , root ,
200- & ldev -> ctx .table [id ],
201- & lowpan_ctx_plen_fops );
202- if (!dentry )
203- return - EINVAL ;
185+ debugfs_create_file ("prefix" , 0644 , root , & ldev -> ctx .table [id ],
186+ & lowpan_ctx_pfx_fops );
204187
205- return 0 ;
188+ debugfs_create_file ("prefix_len" , 0644 , root , & ldev -> ctx .table [id ],
189+ & lowpan_ctx_plen_fops );
206190}
207191
208192static int lowpan_context_show (struct seq_file * file , void * offset )
@@ -242,78 +226,49 @@ static int lowpan_short_addr_get(void *data, u64 *val)
242226DEFINE_DEBUGFS_ATTRIBUTE (lowpan_short_addr_fops , lowpan_short_addr_get , NULL ,
243227 "0x%04llx\n" );
244228
245- static int lowpan_dev_debugfs_802154_init (const struct net_device * dev ,
229+ static void lowpan_dev_debugfs_802154_init (const struct net_device * dev ,
246230 struct lowpan_dev * ldev )
247231{
248- struct dentry * dentry , * root ;
232+ struct dentry * root ;
249233
250234 if (!lowpan_is_ll (dev , LOWPAN_LLTYPE_IEEE802154 ))
251- return 0 ;
235+ return ;
252236
253237 root = debugfs_create_dir ("ieee802154" , ldev -> iface_debugfs );
254- if (!root )
255- return - EINVAL ;
256-
257- dentry = debugfs_create_file_unsafe ("short_addr" , 0444 , root ,
258- lowpan_802154_dev (dev )-> wdev -> ieee802154_ptr ,
259- & lowpan_short_addr_fops );
260- if (!dentry )
261- return - EINVAL ;
262238
263- return 0 ;
239+ debugfs_create_file ("short_addr" , 0444 , root ,
240+ lowpan_802154_dev (dev )-> wdev -> ieee802154_ptr ,
241+ & lowpan_short_addr_fops );
264242}
265243
266- int lowpan_dev_debugfs_init (struct net_device * dev )
244+ void lowpan_dev_debugfs_init (struct net_device * dev )
267245{
268246 struct lowpan_dev * ldev = lowpan_dev (dev );
269- struct dentry * contexts , * dentry ;
270- int ret , i ;
247+ struct dentry * contexts ;
248+ int i ;
271249
272250 /* creating the root */
273251 ldev -> iface_debugfs = debugfs_create_dir (dev -> name , lowpan_debugfs );
274- if (!ldev -> iface_debugfs )
275- goto fail ;
276252
277253 contexts = debugfs_create_dir ("contexts" , ldev -> iface_debugfs );
278- if (!contexts )
279- goto remove_root ;
280-
281- dentry = debugfs_create_file ("show" , 0644 , contexts ,
282- & lowpan_dev (dev )-> ctx ,
283- & lowpan_context_fops );
284- if (!dentry )
285- goto remove_root ;
286-
287- for (i = 0 ; i < LOWPAN_IPHC_CTX_TABLE_SIZE ; i ++ ) {
288- ret = lowpan_dev_debugfs_ctx_init (dev , contexts , i );
289- if (ret < 0 )
290- goto remove_root ;
291- }
292254
293- ret = lowpan_dev_debugfs_802154_init (dev , ldev );
294- if (ret < 0 )
295- goto remove_root ;
255+ debugfs_create_file ("show" , 0644 , contexts , & lowpan_dev (dev )-> ctx ,
256+ & lowpan_context_fops );
296257
297- return 0 ;
258+ for (i = 0 ; i < LOWPAN_IPHC_CTX_TABLE_SIZE ; i ++ )
259+ lowpan_dev_debugfs_ctx_init (dev , contexts , i );
298260
299- remove_root :
300- lowpan_dev_debugfs_exit (dev );
301- fail :
302- return - EINVAL ;
261+ lowpan_dev_debugfs_802154_init (dev , ldev );
303262}
304263
305264void lowpan_dev_debugfs_exit (struct net_device * dev )
306265{
307266 debugfs_remove_recursive (lowpan_dev (dev )-> iface_debugfs );
308267}
309268
310- int __init lowpan_debugfs_init (void )
269+ void __init lowpan_debugfs_init (void )
311270{
312271 lowpan_debugfs = debugfs_create_dir ("6lowpan" , NULL );
313- if (!lowpan_debugfs )
314- return - EINVAL ;
315-
316- return 0 ;
317272}
318273
319274void lowpan_debugfs_exit (void )
0 commit comments