devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 02/11] usb: musb: kill global and static for multi instance
@ 2012-07-25 12:12 Ajay Kumar Gupta
       [not found] ` <1343218326-30610-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Ajay Kumar Gupta @ 2012-07-25 12:12 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ, Ajay Kumar Gupta

Moved global variable "musb_debugfs_root" and static variable
"old_state" to 'struct musb' to help support multi instance of
musb controller as present on AM335x platform.

Also removed the global variable "orig_dma_mask" and filled the
dev->dma_mask with parent device's dma_mask.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/musb/musb_core.c    |   22 +++++++---------------
 drivers/usb/musb/musb_core.h    |    4 ++++
 drivers/usb/musb/musb_debugfs.c |   14 ++++++++------
 3 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index f5eb8a7..cfd93b7 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -100,6 +100,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/idr.h>
+#include <linux/dma-mapping.h>
 
 #include "musb_core.h"
 
@@ -1804,10 +1805,9 @@ static const struct attribute_group musb_attr_group = {
 static void musb_irq_work(struct work_struct *data)
 {
 	struct musb *musb = container_of(data, struct musb, irq_work);
-	static int old_state;
 
-	if (musb->xceiv->state != old_state) {
-		old_state = musb->xceiv->state;
+	if (musb->xceiv->state != musb->xceiv_old_state) {
+		musb->xceiv_old_state = musb->xceiv->state;
 		sysfs_notify(&musb->controller->kobj, NULL, "mode");
 	}
 }
@@ -2117,11 +2117,6 @@ fail0:
 /* all implementations (PCI bridge to FPGA, VLYNQ, etc) should just
  * bridge to a platform device; this driver then suffices.
  */
-
-#ifndef CONFIG_MUSB_PIO_ONLY
-static u64	*orig_dma_mask;
-#endif
-
 static int __devinit musb_probe(struct platform_device *pdev)
 {
 	struct device	*dev = &pdev->dev;
@@ -2140,10 +2135,6 @@ static int __devinit musb_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-#ifndef CONFIG_MUSB_PIO_ONLY
-	/* clobbered by use_dma=n */
-	orig_dma_mask = dev->dma_mask;
-#endif
 	status = musb_init_controller(dev, irq, base);
 	if (status < 0)
 		iounmap(base);
@@ -2153,7 +2144,8 @@ static int __devinit musb_probe(struct platform_device *pdev)
 
 static int __devexit musb_remove(struct platform_device *pdev)
 {
-	struct musb	*musb = dev_to_musb(&pdev->dev);
+	struct device	*dev = &pdev->dev;
+	struct musb	*musb = dev_to_musb(dev);
 	void __iomem	*ctrl_base = musb->ctrl_base;
 
 	/* this gets called on rmmod.
@@ -2166,9 +2158,9 @@ static int __devexit musb_remove(struct platform_device *pdev)
 
 	musb_free(musb);
 	iounmap(ctrl_base);
-	device_init_wakeup(&pdev->dev, 0);
+	device_init_wakeup(dev, 0);
 #ifndef CONFIG_MUSB_PIO_ONLY
-	pdev->dev.dma_mask = orig_dma_mask;
+	dma_set_mask(dev, *dev->parent->dma_mask);
 #endif
 	return 0;
 }
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 69ed141..6b6cee9 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -452,6 +452,10 @@ struct musb {
 #endif
 	/* id for multiple musb instances */
 	u8			id;
+	int                     xceiv_old_state;
+#ifdef CONFIG_DEBUG_FS
+	struct dentry           *debugfs_root;
+#endif
 };
 
 static inline struct musb *gadget_to_musb(struct usb_gadget *g)
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 40a37c9..b1e8f21 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -103,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;
@@ -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);
 	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);
 	file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,
 			root, musb, &musb_test_mode_fops);
 	if (!file) {
@@ -261,7 +263,7 @@ int __devinit musb_init_debugfs(struct musb *musb)
 		goto err1;
 	}
 
-	musb_debugfs_root = root;
+	musb->debugfs_root = root;
 
 	return 0;
 
@@ -274,5 +276,5 @@ err0:
 
 void /* __init_or_exit */ musb_exit_debugfs(struct musb *musb)
 {
-	debugfs_remove_recursive(musb_debugfs_root);
+	debugfs_remove_recursive(musb->debugfs_root);
 }
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
       [not found] ` <1343218326-30610-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
@ 2012-07-26  7:40   ` Felipe Balbi
       [not found]     ` <20120726074057.GH29029-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2012-07-26  7:40 UTC (permalink / raw)
  To: Ajay Kumar Gupta
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	tony-4v6yS6AI5VpBDgjK7y7TUQ

[-- 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 --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
       [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>
  0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2012-07-26  8:25 UTC (permalink / raw)
  To: Gupta, Ajay Kumar
  Cc: Balbi, Felipe, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org

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

On Thu, Jul 26, 2012 at 08:25:32AM +0000, Gupta, Ajay Kumar wrote:
> 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" ??
> 
> We are now using musb_ida for all glue layers so '-1' issue will not come.

true.

> Still if we can manage without 'id' then better to do that way.

just make sure to notice that directory name will "musb.0".

-- 
balbi

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
       [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>
  0 siblings, 1 reply; 8+ messages in thread
From: Gupta, Ajay Kumar @ 2012-07-26  8:25 UTC (permalink / raw)
  To: Balbi, Felipe
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org

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" ??

We are now using musb_ida for all glue layers so '-1' issue will not come.
Still if we can manage without 'id' then better to do that way.

Ajay
> 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).

L
> 
> >  	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
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
       [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>
  0 siblings, 1 reply; 8+ messages in thread
From: Gupta, Ajay Kumar @ 2012-07-26  8:29 UTC (permalink / raw)
  To: Balbi, Felipe
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org

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" ??
> >
> > We are now using musb_ida for all glue layers so '-1' issue will not come.
> 
> true.
> 
> > Still if we can manage without 'id' then better to do that way.
> 
> just make sure to notice that directory name will "musb.0".

Sure.

Ajay
> 
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
       [not found]                 ` <47CEF8C4B26E8C44B22B028A650E0EA93EAEF877-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2012-07-26 12:46                   ` Gupta, Ajay Kumar
  2012-07-26 13:06                     ` Felipe Balbi
  0 siblings, 1 reply; 8+ messages in thread
From: Gupta, Ajay Kumar @ 2012-07-26 12:46 UTC (permalink / raw)
  To: Balbi, Felipe
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org

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" ??
> > >
> > > We are now using musb_ida for all glue layers so '-1' issue will not
> come.
> >
> > true.
> >
> > > Still if we can manage without 'id' then better to do that way.
> >
> > just make sure to notice that directory name will "musb.0".

It creates musb-hdrc.0 and musb-hdrc.1 as glue layers use "musb-hdrc"
name in platform_device_alloc() call.

Ajay
> 
> Sure.
> 
> Ajay
> >
> > --
> > balbi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
  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>
  0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2012-07-26 13:06 UTC (permalink / raw)
  To: Gupta, Ajay Kumar
  Cc: Balbi, Felipe, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, grant.likely@secretlab.ca,
	devicetree-discuss@lists.ozlabs.org, tony@atomide.com

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

On Thu, Jul 26, 2012 at 12:46:43PM +0000, Gupta, Ajay Kumar wrote:
> 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" ??
> > > >
> > > > We are now using musb_ida for all glue layers so '-1' issue will not
> > come.
> > >
> > > true.
> > >
> > > > Still if we can manage without 'id' then better to do that way.
> > >
> > > just make sure to notice that directory name will "musb.0".
> 
> It creates musb-hdrc.0 and musb-hdrc.1 as glue layers use "musb-hdrc"
> name in platform_device_alloc() call.

yes, indeed. That shouldn't be a problem though... what do you think ?

-- 
balbi

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v5 02/11] usb: musb: kill global and static for multi instance
       [not found]                       ` <20120726130613.GA2378-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2012-07-26 13:16                         ` Gupta, Ajay Kumar
  0 siblings, 0 replies; 8+ messages in thread
From: Gupta, Ajay Kumar @ 2012-07-26 13:16 UTC (permalink / raw)
  To: Balbi, Felipe
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org

Hi
> On Thu, Jul 26, 2012 at 12:46:43PM +0000, Gupta, Ajay Kumar wrote:
> > 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" ??
> > > > >
> > > > > We are now using musb_ida for all glue layers so '-1' issue will
> > > > > not
> > > come.
> > > >
> > > > true.
> > > >
> > > > > Still if we can manage without 'id' then better to do that way.
> > > >
> > > > just make sure to notice that directory name will "musb.0".
> >
> > It creates musb-hdrc.0 and musb-hdrc.1 as glue layers use "musb-hdrc"
> > name in platform_device_alloc() call.
> 
> yes, indeed. That shouldn't be a problem though... what do you think ?

I agree with you as that should be fine.

Ajay
> 
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-07-26 13:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
     [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

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).