diff options
Diffstat (limited to 'drivers/usb/musb/musb_debugfs.c')
| -rw-r--r-- | drivers/usb/musb/musb_debugfs.c | 37 | 
1 files changed, 10 insertions, 27 deletions
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c index 9e8639d4e86..4c216790e86 100644 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c @@ -33,30 +33,15 @@  #include <linux/module.h>  #include <linux/kernel.h> -#include <linux/sched.h>  #include <linux/init.h> -#include <linux/list.h> -#include <linux/kobject.h> -#include <linux/platform_device.h> -#include <linux/io.h>  #include <linux/debugfs.h>  #include <linux/seq_file.h> -#ifdef	CONFIG_ARM -#include <mach/hardware.h> -#include <mach/memory.h> -#include <asm/mach-types.h> -#endif -  #include <asm/uaccess.h>  #include "musb_core.h"  #include "musb_debug.h" -#ifdef CONFIG_ARCH_DAVINCI -#include "davinci.h" -#endif -  struct musb_register_map {  	char			*name;  	unsigned		offset; @@ -118,8 +103,6 @@ static const struct musb_register_map musb_regmap[] = {  	{  }	/* Terminating Entry */  }; -static struct dentry *musb_debugfs_root; -  static int musb_regdump_show(struct seq_file *s, void *unused)  {  	struct musb		*musb = s->private; @@ -250,33 +233,33 @@ static const struct file_operations musb_test_mode_fops = {  	.release		= single_release,  }; -int __init musb_init_debugfs(struct musb *musb) +int musb_init_debugfs(struct musb *musb)  {  	struct dentry		*root;  	struct dentry		*file;  	int			ret; -	root = debugfs_create_dir("musb", NULL); -	if (IS_ERR(root)) { -		ret = PTR_ERR(root); +	root = debugfs_create_dir(dev_name(musb->controller), NULL); +	if (!root) { +		ret = -ENOMEM;  		goto err0;  	}  	file = debugfs_create_file("regdump", S_IRUGO, root, musb,  			&musb_regdump_fops); -	if (IS_ERR(file)) { -		ret = PTR_ERR(file); +	if (!file) { +		ret = -ENOMEM;  		goto err1;  	}  	file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,  			root, musb, &musb_test_mode_fops); -	if (IS_ERR(file)) { -		ret = PTR_ERR(file); +	if (!file) { +		ret = -ENOMEM;  		goto err1;  	} -	musb_debugfs_root = root; +	musb->debugfs_root = root;  	return 0; @@ -289,5 +272,5 @@ err0:  void /* __init_or_exit */ musb_exit_debugfs(struct musb *musb)  { -	debugfs_remove_recursive(musb_debugfs_root); +	debugfs_remove_recursive(musb->debugfs_root);  }  | 
