@@ -206,7 +206,7 @@ static int debugfs_show(struct seq_file *m, void *p)
206
206
char buf [256 ];
207
207
const char * filename ;
208
208
size_t len , nbytes ;
209
- int ret ;
209
+ int err ;
210
210
211
211
filename = get_filename (bpmp , file , buf , sizeof (buf ));
212
212
if (!filename )
@@ -220,24 +220,24 @@ static int debugfs_show(struct seq_file *m, void *p)
220
220
datavirt = dma_alloc_coherent (bpmp -> dev , datasize , & dataphys ,
221
221
GFP_KERNEL | GFP_DMA32 );
222
222
if (!datavirt ) {
223
- ret = - ENOMEM ;
223
+ err = - ENOMEM ;
224
224
goto free_namebuf ;
225
225
}
226
226
227
227
len = strlen (filename );
228
228
strncpy (namevirt , filename , namesize );
229
229
230
- ret = mrq_debugfs_read (bpmp , namephys , len , dataphys , datasize ,
230
+ err = mrq_debugfs_read (bpmp , namephys , len , dataphys , datasize ,
231
231
& nbytes );
232
232
233
- if (!ret )
233
+ if (!err )
234
234
seq_write (m , datavirt , nbytes );
235
235
236
236
dma_free_coherent (bpmp -> dev , datasize , datavirt , dataphys );
237
237
free_namebuf :
238
238
dma_free_coherent (bpmp -> dev , namesize , namevirt , namephys );
239
239
240
- return ret ;
240
+ return err ;
241
241
}
242
242
243
243
static int debugfs_open (struct inode * inode , struct file * file )
@@ -257,7 +257,7 @@ static ssize_t debugfs_store(struct file *file, const char __user *buf,
257
257
char fnamebuf [256 ];
258
258
const char * filename ;
259
259
size_t len ;
260
- int ret ;
260
+ int err ;
261
261
262
262
filename = get_filename (bpmp , file , fnamebuf , sizeof (fnamebuf ));
263
263
if (!filename )
@@ -271,27 +271,27 @@ static ssize_t debugfs_store(struct file *file, const char __user *buf,
271
271
datavirt = dma_alloc_coherent (bpmp -> dev , datasize , & dataphys ,
272
272
GFP_KERNEL | GFP_DMA32 );
273
273
if (!datavirt ) {
274
- ret = - ENOMEM ;
274
+ err = - ENOMEM ;
275
275
goto free_namebuf ;
276
276
}
277
277
278
278
len = strlen (filename );
279
279
strncpy (namevirt , filename , namesize );
280
280
281
281
if (copy_from_user (datavirt , buf , count )) {
282
- ret = - EFAULT ;
282
+ err = - EFAULT ;
283
283
goto free_databuf ;
284
284
}
285
285
286
- ret = mrq_debugfs_write (bpmp , namephys , len , dataphys ,
286
+ err = mrq_debugfs_write (bpmp , namephys , len , dataphys ,
287
287
count );
288
288
289
289
free_databuf :
290
290
dma_free_coherent (bpmp -> dev , datasize , datavirt , dataphys );
291
291
free_namebuf :
292
292
dma_free_coherent (bpmp -> dev , namesize , namevirt , namephys );
293
293
294
- return ret ?: count ;
294
+ return err ?: count ;
295
295
}
296
296
297
297
static const struct file_operations debugfs_fops = {
@@ -380,8 +380,8 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
380
380
void * virt ;
381
381
const size_t sz = SZ_512K ;
382
382
size_t nbytes ;
383
- int ret ;
384
383
struct dentry * root ;
384
+ int err ;
385
385
386
386
if (!tegra_bpmp_mrq_is_supported (bpmp , MRQ_DEBUGFS ))
387
387
return 0 ;
@@ -393,24 +393,24 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
393
393
virt = dma_alloc_coherent (bpmp -> dev , sz , & phys ,
394
394
GFP_KERNEL | GFP_DMA32 );
395
395
if (!virt ) {
396
- ret = - ENOMEM ;
396
+ err = - ENOMEM ;
397
397
goto out ;
398
398
}
399
399
400
- ret = mrq_debugfs_dumpdir (bpmp , phys , sz , & nbytes );
401
- if (ret < 0 ) {
400
+ err = mrq_debugfs_dumpdir (bpmp , phys , sz , & nbytes );
401
+ if (err < 0 ) {
402
402
goto free ;
403
403
} else if (nbytes > sz ) {
404
- ret = - EINVAL ;
404
+ err = - EINVAL ;
405
405
goto free ;
406
406
}
407
407
408
- ret = create_debugfs_mirror (bpmp , virt , nbytes , root );
408
+ err = create_debugfs_mirror (bpmp , virt , nbytes , root );
409
409
free :
410
410
dma_free_coherent (bpmp -> dev , sz , virt , phys );
411
411
out :
412
- if (ret < 0 )
412
+ if (err < 0 )
413
413
debugfs_remove (root );
414
414
415
- return ret ;
415
+ return err ;
416
416
}
0 commit comments