devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
Date: Thu, 26 Jul 2012 10:40:58 +0300	[thread overview]
Message-ID: <20120726074057.GH29029@arwen.pp.htv.fi> (raw)
In-Reply-To: <1343218326-30610-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

Hi,

On Wed, Jul 25, 2012 at 05:42:06PM +0530, Ajay Kumar Gupta wrote:
> @@ -240,20 +238,24 @@ int __devinit musb_init_debugfs(struct musb *musb)
>  	struct dentry		*root;
>  	struct dentry		*file;
>  	int			ret;
> +	char			name[10];
>  
> -	root = debugfs_create_dir("musb", NULL);
> +	sprintf(name, "musb%d", musb->id);
> +	root = debugfs_create_dir(name, NULL);

I told you to use dev_name(musb) for a reason. See what happens when you
use dev_name(musb);

Do you not think about the other users of this driver ? Do you not know
what's the ID on platform_devices which "don't have an ID" ?? The
drivers core set it to -1, then on everybody who's got a single musb
instance, will have to access the "musb-1" directory. That doesn't seem
nice.

Just use dev_name(musb).

>  	if (!root) {
>  		ret = -ENOMEM;
>  		goto err0;
>  	}
>  
> -	file = debugfs_create_file("regdump", S_IRUGO, root, musb,
> +	sprintf(name, "regdump%d", musb->id);
> +	file = debugfs_create_file(name, S_IRUGO, root, musb,
>  			&musb_regdump_fops);
>  	if (!file) {
>  		ret = -ENOMEM;
>  		goto err1;
>  	}
>  
> +	sprintf(name, "testmode%d", musb->id);

this is unnecessary!! Only the directory name needs this trick,
whatever's under the root directory does not need any ID appended to it.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2012-07-26  7:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 12:12 [PATCH v5 02/11] usb: musb: kill global and static for multi instance Ajay Kumar Gupta
     [not found] ` <1343218326-30610-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2012-07-26  7:40   ` Felipe Balbi [this message]
     [not found]     ` <20120726074057.GH29029-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-07-26  8:25       ` Gupta, Ajay Kumar
     [not found]         ` <47CEF8C4B26E8C44B22B028A650E0EA93EAEF790-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-07-26  8:25           ` Felipe Balbi
     [not found]             ` <20120726082459.GP29029-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-07-26  8:29               ` Gupta, Ajay Kumar
     [not found]                 ` <47CEF8C4B26E8C44B22B028A650E0EA93EAEF877-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-07-26 12:46                   ` Gupta, Ajay Kumar
2012-07-26 13:06                     ` Felipe Balbi
     [not found]                       ` <20120726130613.GA2378-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-07-26 13:16                         ` Gupta, Ajay Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120726074057.GH29029@arwen.pp.htv.fi \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=ajay.gupta-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).