* [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses
@ 2007-08-15 14:08 Felipe Balbi
2007-08-15 16:13 ` David Brownell
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2007-08-15 14:08 UTC (permalink / raw)
To: tony; +Cc: linux-omap-open-source
Code cleanup:
* Convert pr_*() to dev_*() macros
* Convert printk() to dev_*() macros
* Convert missing pr_*() to {info, err, dbg}() macros
Signed-off-by: Felipe Balbi <felipe.lima@indt.org.br>
---
drivers/usb/musb/cppi_dma.c | 2 +-
drivers/usb/musb/davinci.c | 2 +-
drivers/usb/musb/g_ep0.c | 8 +++---
drivers/usb/musb/musb_gadget.c | 7 ++---
drivers/usb/musb/musb_procfs.c | 4 +-
drivers/usb/musb/omap2430.c | 2 +-
drivers/usb/musb/plat_uds.c | 50 ++++++++++++++++------------------------
drivers/usb/musb/tusb6010.c | 6 ++--
drivers/usb/musb/virthub.c | 12 ++++----
9 files changed, 41 insertions(+), 52 deletions(-)
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
index 25941b5..75000c1 100644
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -430,7 +430,7 @@ cppi_rndis_update(struct cppi_channel *c, int is_rx,
static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd)
{
- pr_debug("RXBD/%s %08x: "
+ dbg("RXBD/%s %08x: "
"nxt %08x buf %08x off.blen %08x opt.plen %08x\n",
tag, bd->dma,
bd->hNext, bd->buffPtr, bd->bOffBLen, bd->hOptions);
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 3324543..2fa68f1 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -415,7 +415,7 @@ int __init musb_platform_init(struct musb *musb)
msleep(5);
/* NOTE: irqs are in mixed mode, not bypass to pure-musb */
- pr_debug("DaVinci OTG revision %08x phy %03x control %02x\n",
+ dbg("DaVinci OTG revision %08x phy %03x control %02x\n",
revision,
__raw_readl((void *__iomem) IO_ADDRESS(USBPHY_CTL_PADDR)),
musb_readb(tibase, DAVINCI_USB_CTRL_REG));
diff --git a/drivers/usb/musb/g_ep0.c b/drivers/usb/musb/g_ep0.c
index e1cbf18..3690297 100644
--- a/drivers/usb/musb/g_ep0.c
+++ b/drivers/usb/musb/g_ep0.c
@@ -304,26 +304,26 @@ __acquires(musb->lock)
switch (ctrlrequest->wIndex >> 8) {
case 1:
- pr_debug("TEST_J\n");
+ dbg("TEST_J\n");
/* TEST_J */
musb->test_mode_nr =
MGC_M_TEST_J;
break;
case 2:
/* TEST_K */
- pr_debug("TEST_K\n");
+ dbg("TEST_K\n");
musb->test_mode_nr =
MGC_M_TEST_K;
break;
case 3:
/* TEST_SE0_NAK */
- pr_debug("TEST_SE0_NAK\n");
+ dbg("TEST_SE0_NAK\n");
musb->test_mode_nr =
MGC_M_TEST_SE0_NAK;
break;
case 4:
/* TEST_PACKET */
- pr_debug("TEST_PACKET\n");
+ dbg("TEST_PACKET\n");
musb->test_mode_nr =
MGC_M_TEST_PACKET;
break;
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 4aa82fe..cadc9ee 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -974,8 +974,8 @@ static int musb_gadget_enable(struct usb_ep *ep,
musb_ep->busy = 0;
status = 0;
- pr_debug("%s periph: enabled %s for %s %s, %smaxpacket %d\n",
- musb_driver_name, musb_ep->end_point.name,
+ dev_dbg(musb->controller, "periph: enabled %s for %s %s, %smaxpacket %d\n",
+ musb_ep->end_point.name,
({ char *s; switch (musb_ep->type) {
case USB_ENDPOINT_XFER_BULK: s = "bulk"; break;
case USB_ENDPOINT_XFER_INT: s = "int"; break;
@@ -1704,8 +1704,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
spin_lock_irqsave(&musb->lock, flags);
if (musb->gadget_driver) {
- DBG(1, "%s is already bound to %s\n",
- musb_driver_name,
+ dev_dbg(musb->controller, "is already bound to %s\n",
musb->gadget_driver->driver.name);
retval = -EBUSY;
} else {
diff --git a/drivers/usb/musb/musb_procfs.c b/drivers/usb/musb/musb_procfs.c
index b141a73..f46f50a 100644
--- a/drivers/usb/musb/musb_procfs.c
+++ b/drivers/usb/musb/musb_procfs.c
@@ -846,9 +846,9 @@ musb_debug_create(char *name, struct musb *data)
pde->size = 0;
- pr_debug("Registered /proc/%s\n", name);
+ dbg("Registered /proc/%s\n", name);
} else {
- pr_debug("Cannot create a valid proc file entry");
+ dbg("Cannot create a valid proc file entry");
}
return pde;
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 65f2c22..55e9b4a 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -111,7 +111,7 @@ int __init musb_platform_init(struct musb *musb)
OTG_INTERFSEL_REG |= ULPI_12PIN;
- pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, "
+ dbg("HS USB OTG: revision 0x%x, sysconfig 0x%02x, "
"sysstatus 0x%x, intrfsel 0x%x, simenable 0x%x\n",
OTG_REVISION_REG, OTG_SYSCONFIG_REG, OTG_SYSSTATUS_REG,
OTG_INTERFSEL_REG, OTG_SIMENABLE_REG);
diff --git a/drivers/usb/musb/plat_uds.c b/drivers/usb/musb/plat_uds.c
index b87c587..089486e 100644
--- a/drivers/usb/musb/plat_uds.c
+++ b/drivers/usb/musb/plat_uds.c
@@ -114,7 +114,6 @@
#endif
-
#if MUSB_DEBUG > 0
unsigned debug = MUSB_DEBUG;
module_param(debug, uint, 0);
@@ -1128,8 +1127,7 @@ static int __init ep_config_from_table(struct musb *musb)
break;
}
- printk(KERN_DEBUG "%s: setup fifo_mode %d\n",
- musb_driver_name, fifo_mode);
+ dev_dbg(musb->controller, "setup fifo_mode %d\n", fifo_mode);
offset = fifo_setup(musb, hw_ep, &ep0_cfg, 0);
@@ -1143,28 +1141,25 @@ static int __init ep_config_from_table(struct musb *musb)
u8 epn = cfg->hw_ep_num;
if (epn >= MUSB_C_NUM_EPS) {
- pr_debug( "%s: invalid ep %d\n",
- musb_driver_name, epn);
+ dev_dbg(musb->controller, "invalid ep %d\n", epn);
continue;
}
offset = fifo_setup(musb, hw_ep + epn, cfg++, offset);
if (offset < 0) {
- pr_debug( "%s: mem overrun, ep %d\n",
- musb_driver_name, epn);
+ dev_dbg(musb->controller, "mem overrun, ep %d\n", epn);
return -EINVAL;
}
epn++;
musb->nr_endpoints = max(epn, musb->nr_endpoints);
}
- printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n",
- musb_driver_name,
+ dev_dbg(musb->controller, "%d/%d max ep, %d/%d memory\n",
n + 1, MUSB_C_NUM_EPS * 2 - 1,
offset, DYN_FIFO_SIZE);
#ifdef CONFIG_USB_MUSB_HDRC_HCD
if (!musb->bulk_ep) {
- pr_debug( "%s: missing bulk\n", musb_driver_name);
+ dev_dbg(musb->controller, "missing bulk\n");
return -EINVAL;
}
#endif
@@ -1231,7 +1226,7 @@ static int __init ep_config_from_hw(struct musb *musb)
#ifdef CONFIG_USB_MUSB_HDRC_HCD
if (!musb->bulk_ep) {
- pr_debug( "%s: missing bulk\n", musb_driver_name);
+ dev_dbg(musb->controller, "missing bulk\n");
return -EINVAL;
}
#endif
@@ -1293,8 +1288,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
strcat(aInfo, ", SoftConn");
}
- printk(KERN_DEBUG "%s: ConfigData=0x%02x (%s)\n",
- musb_driver_name, reg, aInfo);
+ dev_dbg(musb->controller, "ConfigData=0x%02x (%s)\n", reg, aInfo);
#ifdef MUSB_AHB_ID
dwData = musb_readl(mbase, 0x404);
@@ -1318,9 +1312,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
type = "";
#ifdef CONFIG_USB_MUSB_HDRC_HCD
#ifndef CONFIG_USB_OTG_BLACKLIST_HUB
- printk(KERN_ERR
- "%s: kernel must blacklist external hubs\n",
- musb_driver_name);
+ dev_err(musb->controller, "kernel must blacklist external hubs\n");
#endif
#endif
}
@@ -1331,8 +1323,8 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
wRelMinor = wRelease & 0x3ff;
snprintf(aRevision, 32, "%d.%d%s", wRelMajor,
wRelMinor, (wRelease & 0x8000) ? "RC" : "");
- printk(KERN_DEBUG "%s: %sHDRC RTL version %s %s\n",
- musb_driver_name, type, aRevision, aDate);
+ dev_dbg(musb->controller, "%sHDRC RTL version %s %s\n",
+ type, aRevision, aDate);
/* configure ep0 */
musb->endpoints[0].max_packet_sz_tx = MGC_END0_FIFOSIZE;
@@ -1386,19 +1378,18 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
#endif
if (hw_ep->max_packet_sz_tx) {
- printk(KERN_DEBUG
- "%s: hw_ep %d%s, %smax %d\n",
- musb_driver_name, i,
- hw_ep->is_shared_fifo ? "shared" : "tx",
+ dev_dbg(musb->controller,
+ "hw_ep %d%s, %smax %d\n",
+ i, hw_ep->is_shared_fifo
+ ? "shared" : "tx",
hw_ep->tx_double_buffered
? "doublebuffer, " : "",
hw_ep->max_packet_sz_tx);
}
if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) {
- printk(KERN_DEBUG
- "%s: hw_ep %d%s, %smax %d\n",
- musb_driver_name, i,
- "rx",
+ dev_dbg(musb->controller,
+ "hw_ep %d%s, %smax %d\n",
+ i, "rx",
hw_ep->rx_double_buffered
? "doublebuffer, " : "",
hw_ep->max_packet_sz_rx);
@@ -1953,8 +1944,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
if (enable_irq_wake(nIrq) == 0)
device_init_wakeup(dev, 1);
- pr_info("%s: USB %s mode controller at %p using %s, IRQ %d\n",
- musb_driver_name,
+ dev_info(musb->controller, "USB %s mode controller at %p using %s, IRQ %d\n",
({char *s;
switch (musb->board_mode) {
case MUSB_HOST: s = "Host"; break;
@@ -2178,7 +2168,7 @@ static int __init musb_init(void)
return 0;
#endif
- pr_info("%s: version " MUSB_VERSION ", "
+ info("musb_hdrc: version " MUSB_VERSION ", "
#ifdef CONFIG_USB_INVENTRA_FIFO
"pio"
#elif defined(CONFIG_USB_TI_CPPI_DMA)
@@ -2199,7 +2189,7 @@ static int __init musb_init(void)
"host"
#endif
", debug=%d\n",
- musb_driver_name, debug);
+ debug);
return platform_driver_probe(&musb_driver, musb_probe);
}
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index d43b5cc..9b11e10 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -57,7 +57,7 @@ static int __init tusb_print_revision(struct musb *musb)
rev = tusb_get_revision(musb);
- pr_info("tusb: %s%i.%i %s%i.%i %s%i.%i %s%i.%i %s%i %s%i.%i\n",
+ info("tusb: %s%i.%i %s%i.%i %s%i.%i %s%i.%i %s%i %s%i.%i\n",
"prcm",
TUSB_REV_MAJOR(musb_readl(base, TUSB_PRCM_REV)),
TUSB_REV_MINOR(musb_readl(base, TUSB_PRCM_REV)),
@@ -1089,14 +1089,14 @@ int __init musb_platform_init(struct musb *musb)
/* dma address for sync dma */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!mem) {
- pr_debug("no sync dma resource?\n");
+ dbg("no sync dma resource?\n");
return -ENODEV;
}
musb->sync = mem->start;
sync = ioremap(mem->start, mem->end - mem->start + 1);
if (!sync) {
- pr_debug("ioremap for sync failed\n");
+ dbg("ioremap for sync failed\n");
return -ENOMEM;
}
musb->sync_va = sync;
diff --git a/drivers/usb/musb/virthub.c b/drivers/usb/musb/virthub.c
index 5ad1614..8ba8162 100644
--- a/drivers/usb/musb/virthub.c
+++ b/drivers/usb/musb/virthub.c
@@ -367,31 +367,31 @@ int musb_hub_control(
wIndex >>= 8;
switch (wIndex) {
case 1:
- pr_debug("TEST_J\n");
+ dbg("TEST_J\n");
temp = MGC_M_TEST_J;
break;
case 2:
- pr_debug("TEST_K\n");
+ dbg("TEST_K\n");
temp = MGC_M_TEST_K;
break;
case 3:
- pr_debug("TEST_SE0_NAK\n");
+ dbg("TEST_SE0_NAK\n");
temp = MGC_M_TEST_SE0_NAK;
break;
case 4:
- pr_debug("TEST_PACKET\n");
+ dbg("TEST_PACKET\n");
temp = MGC_M_TEST_PACKET;
musb_load_testpacket(musb);
break;
case 5:
- pr_debug("TEST_FORCE_ENABLE\n");
+ dbg("TEST_FORCE_ENABLE\n");
temp = MGC_M_TEST_FORCE_HOST
| MGC_M_TEST_FORCE_HS;
musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION);
break;
case 6:
- pr_debug("TEST_FIFO_ACCESS\n");
+ dbg("TEST_FIFO_ACCESS\n");
temp = MGC_M_TEST_FIFO_ACCESS;
break;
default:
--
1.5.3.rc4.67.gf9286
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses
2007-08-15 14:08 [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses Felipe Balbi
@ 2007-08-15 16:13 ` David Brownell
2007-08-15 16:29 ` Felipe Balbi
0 siblings, 1 reply; 8+ messages in thread
From: David Brownell @ 2007-08-15 16:13 UTC (permalink / raw)
To: linux-omap-open-source
On Wednesday 15 August 2007, Felipe Balbi wrote:
> * Convert pr_*() to dev_*() macros
That's not always a win, especially in IRQ paths where the extra
text of dev_*() can introduce new timings ... but I won't eyeball
these changes, they're likely at least safe. It's appropriate to
use the pr_*() calls in cases where "there can be only one", so
there's no value in adding the driver name and a device ID.
> * Convert printk() to dev_*() macros
Similarly ... printk() to pr_*() might be better, but I won't
eyeball them.
> * Convert missing pr_*() to {info, err, dbg}() macros
No, please -- don't use those ancient USB-only macros, they're
for legacy code. Plus, you're using them wrong:
> - pr_debug("TEST_J\n");
> + dbg("TEST_J\n");
We don't want *TWO* newlines after each diagnostic message.
Plus, those aren't "missing" at all...
- Dave
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses
2007-08-15 16:13 ` David Brownell
@ 2007-08-15 16:29 ` Felipe Balbi
2007-08-15 16:44 ` David Brownell
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2007-08-15 16:29 UTC (permalink / raw)
To: David Brownell; +Cc: linux-omap-open-source
Hi,
On 8/15/07, David Brownell <david-b@pacbell.net> wrote:
> On Wednesday 15 August 2007, Felipe Balbi wrote:
> > * Convert pr_*() to dev_*() macros
>
> That's not always a win, especially in IRQ paths where the extra
> text of dev_*() can introduce new timings ... but I won't eyeball
> these changes, they're likely at least safe. It's appropriate to
> use the pr_*() calls in cases where "there can be only one", so
> there's no value in adding the driver name and a device ID.
>
>
> > * Convert printk() to dev_*() macros
>
> Similarly ... printk() to pr_*() might be better, but I won't
> eyeball them.
>
>
> > * Convert missing pr_*() to {info, err, dbg}() macros
>
> No, please -- don't use those ancient USB-only macros, they're
> for legacy code. Plus, you're using them wrong:
>
> > -pr_debug("TEST_J\n");
> > +dbg("TEST_J\n");
Oh... sorry forgot to remove that extra '\n' from the message. I'll
fix this, maybe getting back to pr_*. Do you have any other comments
about this? How should I do it right??
Thanks Dave.
>
> We don't want *TWO* newlines after each diagnostic message.
> Plus, those aren't "missing" at all...
>
> - Dave
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>
--
Best Regards,
Felipe Balbi
felipebalbi@users.sourceforge.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses
2007-08-15 16:29 ` Felipe Balbi
@ 2007-08-15 16:44 ` David Brownell
2007-08-15 17:23 ` Take 2 musb_hdrc cleanup (was: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses) Felipe Balbi
2007-08-15 19:47 ` OMAP5912 OSK Boot Hingkwan Huen
0 siblings, 2 replies; 8+ messages in thread
From: David Brownell @ 2007-08-15 16:44 UTC (permalink / raw)
To: Felipe Balbi; +Cc: linux-omap-open-source
On Wednesday 15 August 2007, Felipe Balbi wrote:
> > > * Convert missing pr_*() to {info, err, dbg}() macros
> >
> > No, please -- don't use those ancient USB-only macros, they're
> > for legacy code. Plus, you're using them wrong:
> >
> > > -pr_debug("TEST_J\n");
> > > +dbg("TEST_J\n");
>
> Oh... sorry forgot to remove that extra '\n' from the message. I'll
> fix this, maybe getting back to pr_*. Do you have any other comments
> about this? How should I do it right??
I really don't see anything wrong with pr_*() in most cases.
A patch moving bare printks to something else would be a lot
easier to quickly review than something changing a whole bunch
of other stuff.
- Dave
^ permalink raw reply [flat|nested] 8+ messages in thread
* Take 2 musb_hdrc cleanup (was: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses)
2007-08-15 16:44 ` David Brownell
@ 2007-08-15 17:23 ` Felipe Balbi
2007-08-15 17:23 ` [PATCH] MUSB_HDRC: Convert printk() to dev_* macros Felipe Balbi
2007-08-15 19:47 ` OMAP5912 OSK Boot Hingkwan Huen
1 sibling, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2007-08-15 17:23 UTC (permalink / raw)
To: David Brownell; +Cc: linux-omap-open-source
Hi dave,
> A patch moving bare printks to something else would be a lot
> easier to quickly review than something changing a whole bunch
> of other stuff.
As you asked, here's a patch converting all printk() to dev_*
macros. Does this one look better?
Thanks in advance,
Best Regards,
Felipe Balbi
felipe.lima@indt.org.br
INdT - OSMRC - Manaus
Core Team
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] MUSB_HDRC: Convert printk() to dev_* macros
2007-08-15 17:23 ` Take 2 musb_hdrc cleanup (was: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses) Felipe Balbi
@ 2007-08-15 17:23 ` Felipe Balbi
2007-08-15 17:45 ` David Brownell
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2007-08-15 17:23 UTC (permalink / raw)
To: David Brownell; +Cc: linux-omap-open-source
Code cleanup on musb_hdrc driver converting plain printk to dev_*
Signed-off-by: Felipe Balbi <felipe.lima@indt.org.br>
---
drivers/usb/musb/davinci.c | 2 +-
drivers/usb/musb/g_ep0.c | 5 +--
drivers/usb/musb/plat_uds.c | 45 ++++++++++++++++----------------------
drivers/usb/musb/tusb6010.c | 12 +++++-----
drivers/usb/musb/tusb6010_omap.c | 5 ++-
5 files changed, 31 insertions(+), 38 deletions(-)
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 3324543..ff9acba 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -91,7 +91,7 @@ void musb_platform_enable(struct musb *musb)
musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp);
if (is_dma_capable() && !dma_off)
- printk(KERN_WARNING "%s %s: dma not reactivated\n",
+ dev_warn(musb->controller, "%s %s: dma not reactivated\n",
__FILE__, __FUNCTION__);
else
dma_off = 0;
diff --git a/drivers/usb/musb/g_ep0.c b/drivers/usb/musb/g_ep0.c
index e1cbf18..a0faca2 100644
--- a/drivers/usb/musb/g_ep0.c
+++ b/drivers/usb/musb/g_ep0.c
@@ -707,9 +707,8 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb)
if (unlikely(musb->g.speed == USB_SPEED_UNKNOWN)) {
u8 power;
- printk(KERN_NOTICE "%s: peripheral reset "
- "irq lost!\n",
- musb_driver_name);
+ dev_notice(musb->controller, "peripheral reset "
+ "irq lost!\n");
power = musb_readb(mbase, MGC_O_HDRC_POWER);
musb->g.speed = (power & MGC_M_POWER_HSMODE)
? USB_SPEED_HIGH : USB_SPEED_FULL;
diff --git a/drivers/usb/musb/plat_uds.c b/drivers/usb/musb/plat_uds.c
index b87c587..86d3477 100644
--- a/drivers/usb/musb/plat_uds.c
+++ b/drivers/usb/musb/plat_uds.c
@@ -114,7 +114,6 @@
#endif
-
#if MUSB_DEBUG > 0
unsigned debug = MUSB_DEBUG;
module_param(debug, uint, 0);
@@ -678,7 +677,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB,
// eliminate duplicated StartUrb logic
if (ep->dwWaitFrame >= wFrame) {
ep->dwWaitFrame = 0;
- printk("SOF --> periodic TX%s on %d\n",
+ dev_info(musb->controller, "SOF --> periodic TX%s on %d\n",
ep->tx_channel ? " DMA" : "",
epnum);
if (!ep->tx_channel)
@@ -1128,8 +1127,7 @@ static int __init ep_config_from_table(struct musb *musb)
break;
}
- printk(KERN_DEBUG "%s: setup fifo_mode %d\n",
- musb_driver_name, fifo_mode);
+ dev_dbg(musb->controller, "setup fifo_mode %d\n", fifo_mode);
offset = fifo_setup(musb, hw_ep, &ep0_cfg, 0);
@@ -1157,14 +1155,13 @@ static int __init ep_config_from_table(struct musb *musb)
musb->nr_endpoints = max(epn, musb->nr_endpoints);
}
- printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n",
- musb_driver_name,
+ dev_dbg(musb->controller, "%d/%d max ep, %d/%d memory\n",
n + 1, MUSB_C_NUM_EPS * 2 - 1,
offset, DYN_FIFO_SIZE);
#ifdef CONFIG_USB_MUSB_HDRC_HCD
if (!musb->bulk_ep) {
- pr_debug( "%s: missing bulk\n", musb_driver_name);
+ dev_dbg(musb->controller, "missing bulk\n");
return -EINVAL;
}
#endif
@@ -1293,8 +1290,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
strcat(aInfo, ", SoftConn");
}
- printk(KERN_DEBUG "%s: ConfigData=0x%02x (%s)\n",
- musb_driver_name, reg, aInfo);
+ dev_dbg(musb->controller, "ConfigData=0x%02x (%s)\n", reg, aInfo);
#ifdef MUSB_AHB_ID
dwData = musb_readl(mbase, 0x404);
@@ -1302,9 +1298,9 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
(dwData >> 16) & 0xff, (dwData >> 24) & 0xff);
/* FIXME ID2 and ID3 are unused */
dwData = musb_readl(mbase, 0x408);
- printk("ID2=%lx\n", (long unsigned)dwData);
+ dev_info(musb->controller, "ID2=%lx\n", (long unsigned)dwData);
dwData = musb_readl(mbase, 0x40c);
- printk("ID3=%lx\n", (long unsigned)dwData);
+ dev_info(musb->controller, "ID3=%lx\n", (long unsigned)dwData);
reg = musb_readb(mbase, 0x400);
wType = ('M' == reg) ? MUSB_CONTROLLER_MHDRC : MUSB_CONTROLLER_HDRC;
#else
@@ -1318,9 +1314,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
type = "";
#ifdef CONFIG_USB_MUSB_HDRC_HCD
#ifndef CONFIG_USB_OTG_BLACKLIST_HUB
- printk(KERN_ERR
- "%s: kernel must blacklist external hubs\n",
- musb_driver_name);
+ dev_err(musb->controller, "kernel must blacklist external hubs\n");
#endif
#endif
}
@@ -1331,8 +1325,8 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
wRelMinor = wRelease & 0x3ff;
snprintf(aRevision, 32, "%d.%d%s", wRelMajor,
wRelMinor, (wRelease & 0x8000) ? "RC" : "");
- printk(KERN_DEBUG "%s: %sHDRC RTL version %s %s\n",
- musb_driver_name, type, aRevision, aDate);
+ dev_dbg(musb->controller, "%sHDRC RTL version %s %s\n",
+ type, aRevision, aDate);
/* configure ep0 */
musb->endpoints[0].max_packet_sz_tx = MGC_END0_FIFOSIZE;
@@ -1386,19 +1380,18 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
#endif
if (hw_ep->max_packet_sz_tx) {
- printk(KERN_DEBUG
- "%s: hw_ep %d%s, %smax %d\n",
- musb_driver_name, i,
- hw_ep->is_shared_fifo ? "shared" : "tx",
+ dev_dbg(musb->controller,
+ "hw_ep %d%s, %smax %d\n",
+ i, hw_ep->is_shared_fifo
+ ? "shared" : "tx",
hw_ep->tx_double_buffered
? "doublebuffer, " : "",
hw_ep->max_packet_sz_tx);
}
if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) {
- printk(KERN_DEBUG
- "%s: hw_ep %d%s, %smax %d\n",
- musb_driver_name, i,
- "rx",
+ dev_dbg(musb->controller,
+ "hw_ep %d%s, %smax %d\n",
+ i, "rx",
hw_ep->rx_double_buffered
? "doublebuffer, " : "",
hw_ep->max_packet_sz_rx);
@@ -1676,7 +1669,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr,
spin_lock_irqsave(&musb->lock, flags);
if (sscanf(buf, "%lu", &val) < 1) {
- printk(KERN_ERR "Invalid VBUS timeout ms value\n");
+ dev_err(dev, "Invalid VBUS timeout ms value\n");
return -EINVAL;
}
musb->a_wait_bcon = val;
@@ -1713,7 +1706,7 @@ musb_srp_store(struct device *dev, struct device_attribute *attr,
if (sscanf(buf, "%hu", &srp) != 1
|| (srp != 1)) {
- printk (KERN_ERR "SRP: Value must be 1\n");
+ dev_err(dev, "SRP: Value must be 1\n");
return -EINVAL;
}
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index d43b5cc..29b27a6 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -943,7 +943,7 @@ void musb_platform_enable(struct musb * musb)
TUSB_INT_SRC_ID_STATUS_CHNG);
if (is_dma_capable() && dma_off)
- printk(KERN_WARNING "%s %s: dma not reactivated\n",
+ dev_warn(musb->controller, "%s %s: dma not reactivated\n",
__FILE__, __FUNCTION__);
else
dma_off = 1;
@@ -967,7 +967,7 @@ void musb_platform_disable(struct musb *musb)
del_timer(&musb_idle_timer);
if (is_dma_capable() && !dma_off) {
- printk(KERN_WARNING "%s %s: dma still active\n",
+ dev_warn(musb->controller, "%s %s: dma still active\n",
__FILE__, __FUNCTION__);
dma_off = 1;
}
@@ -1014,7 +1014,7 @@ static int __init tusb_start(struct musb *musb)
if (musb->board_set_power)
ret = musb->board_set_power(1);
if (ret != 0) {
- printk(KERN_ERR "tusb: Cannot enable TUSB6010\n");
+ dev_err(musb->controller, "tusb: Cannot enable TUSB6010\n");
return ret;
}
@@ -1022,13 +1022,13 @@ static int __init tusb_start(struct musb *musb)
if (musb_readl(base, TUSB_PROD_TEST_RESET) !=
TUSB_PROD_TEST_RESET_VAL) {
- printk(KERN_ERR "tusb: Unable to detect TUSB6010\n");
+ dev_err(musb->controller, "tusb: Unable to detect TUSB6010\n");
goto err;
}
ret = tusb_print_revision(musb);
if (ret < 2) {
- printk(KERN_ERR "tusb: Unsupported TUSB6010 revision %i\n",
+ dev_err(musb->controller, "tusb: Unsupported TUSB6010 revision %i\n",
ret);
goto err;
}
@@ -1108,7 +1108,7 @@ int __init musb_platform_init(struct musb *musb)
ret = tusb_start(musb);
if (ret) {
- printk(KERN_ERR "Could not start tusb6010 (%d)\n",
+ dev_err(musb->controller, "Could not start tusb6010 (%d)\n",
ret);
return -ENODEV;
}
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c
index 9359028..91704ff 100644
--- a/drivers/usb/musb/tusb6010_omap.c
+++ b/drivers/usb/musb/tusb6010_omap.c
@@ -119,9 +119,10 @@ static inline int tusb_omap_use_shared_dmareq(struct tusb_omap_dma_ch *chdat)
static inline void tusb_omap_free_shared_dmareq(struct tusb_omap_dma_ch *chdat)
{
u32 reg = musb_readl(chdat->tusb_base, TUSB_DMA_EP_MAP);
+ struct device *dev = chdat->musb->controller;
if ((reg & 0xf) != chdat->epnum) {
- printk(KERN_ERR "ep%i trying to release dmareq0 for ep%i\n",
+ dev_err(dev, "ep%i trying to release dmareq0 for ep%i\n",
chdat->epnum, reg & 0xf);
return;
}
@@ -157,7 +158,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data)
ch = tusb_dma->ch;
if (ch_status != OMAP_DMA_BLOCK_IRQ)
- printk(KERN_ERR "TUSB DMA error status: %i\n", ch_status);
+ dev_err(musb->controller, "TUSB DMA error status: %i\n", ch_status);
DBG(2, "ep%i %s dma callback ch: %i status: %x\n",
chdat->epnum, chdat->tx ? "tx" : "rx",
--
1.5.3.rc4.67.gf9286
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] MUSB_HDRC: Convert printk() to dev_* macros
2007-08-15 17:23 ` [PATCH] MUSB_HDRC: Convert printk() to dev_* macros Felipe Balbi
@ 2007-08-15 17:45 ` David Brownell
0 siblings, 0 replies; 8+ messages in thread
From: David Brownell @ 2007-08-15 17:45 UTC (permalink / raw)
To: Felipe Balbi; +Cc: linux-omap-open-source
On Wednesday 15 August 2007, Felipe Balbi wrote:
> @@ -1128,8 +1127,7 @@ static int __init ep_config_from_table(struct musb *musb)
> break;
> }
>
> - printk(KERN_DEBUG "%s: setup fifo_mode %d\n",
> - musb_driver_name, fifo_mode);
> + dev_dbg(musb->controller, "setup fifo_mode %d\n", fifo_mode);
That change is not equivalent ... in one case the FIFO mode
always gets logged (at low priority), but you've changed it
so that it normally doesn't get logged. Fifo mode can be
quite significant when troubleshooting in the field, since
it affects what drivers can do with the various endpoints
(and hence what driver can even run).
> offset = fifo_setup(musb, hw_ep, &ep0_cfg, 0);
> @@ -1157,14 +1155,13 @@ static int __init ep_config_from_table(struct musb *musb)
> musb->nr_endpoints = max(epn, musb->nr_endpoints);
> }
>
> - printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n",
> - musb_driver_name,
> + dev_dbg(musb->controller, "%d/%d max ep, %d/%d memory\n",
Ditto. This stuff can matter to someone trying to figure out
why after "modprobe ... fifo_mode=X" their system was misbehaving.
> n + 1, MUSB_C_NUM_EPS * 2 - 1,
> offset, DYN_FIFO_SIZE);
>
> @@ -1293,8 +1290,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
> strcat(aInfo, ", SoftConn");
> }
>
> - printk(KERN_DEBUG "%s: ConfigData=0x%02x (%s)\n",
> - musb_driver_name, reg, aInfo);
> + dev_dbg(musb->controller, "ConfigData=0x%02x (%s)\n", reg, aInfo);
Ditto, though in this case config data isn't very useful
except to someone doing low level debugging, so that's OK.
>
> #ifdef MUSB_AHB_ID
> dwData = musb_readl(mbase, 0x404);
> @@ -1302,9 +1298,9 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
> (dwData >> 16) & 0xff, (dwData >> 24) & 0xff);
> /* FIXME ID2 and ID3 are unused */
> dwData = musb_readl(mbase, 0x408);
> - printk("ID2=%lx\n", (long unsigned)dwData);
> + dev_info(musb->controller, "ID2=%lx\n", (long unsigned)dwData);
> dwData = musb_readl(mbase, 0x40c);
> - printk("ID3=%lx\n", (long unsigned)dwData);
> + dev_info(musb->controller, "ID3=%lx\n", (long unsigned)dwData);
These would be better as dev_dbg(). Does this show up
on omapX430 chips, or is all that code still "dead"?
> @@ -1331,8 +1325,8 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
> wRelMinor = wRelease & 0x3ff;
> snprintf(aRevision, 32, "%d.%d%s", wRelMajor,
> wRelMinor, (wRelease & 0x8000) ? "RC" : "");
> - printk(KERN_DEBUG "%s: %sHDRC RTL version %s %s\n",
> - musb_driver_name, type, aRevision, aDate);
> + dev_dbg(musb->controller, "%sHDRC RTL version %s %s\n",
> + type, aRevision, aDate);
Same comment about loss of functionality ... silicon version data
can be very significant for runtime troubleshooting, don't remove
this data from binaries that will be "in the field".
> /* configure ep0 */
> musb->endpoints[0].max_packet_sz_tx = MGC_END0_FIFOSIZE;
> @@ -1386,19 +1380,18 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
> #endif
>
> if (hw_ep->max_packet_sz_tx) {
> - printk(KERN_DEBUG
> - "%s: hw_ep %d%s, %smax %d\n",
> - musb_driver_name, i,
> - hw_ep->is_shared_fifo ? "shared" : "tx",
> + dev_dbg(musb->controller,
> + "hw_ep %d%s, %smax %d\n",
> + i, hw_ep->is_shared_fifo
> + ? "shared" : "tx",
Ditto. Without access to source, this is usually the *ONLY* information
available to userspace about how the endpoints were set up, and that can
be important for in-the-field debugging.
> hw_ep->tx_double_buffered
> ? "doublebuffer, " : "",
> hw_ep->max_packet_sz_tx);
> }
> if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) {
> - printk(KERN_DEBUG
> - "%s: hw_ep %d%s, %smax %d\n",
> - musb_driver_name, i,
> - "rx",
> + dev_dbg(musb->controller,
> + "hw_ep %d%s, %smax %d\n",
> + i, "rx",
... and again ...
> @@ -1713,7 +1706,7 @@ musb_srp_store(struct device *dev, struct device_attribute *attr,
>
> if (sscanf(buf, "%hu", &srp) != 1
> || (srp != 1)) {
> - printk (KERN_ERR "SRP: Value must be 1\n");
> + dev_err(dev, "SRP: Value must be 1\n");
Doesn't this error test look as bogus to you as it does to me?
If there's only one thing a write could mean, don't bother even
looking at the value. And the test below that is clearly made
irrelevant by this test here ...
^ permalink raw reply [flat|nested] 8+ messages in thread
* OMAP5912 OSK Boot
2007-08-15 16:44 ` David Brownell
2007-08-15 17:23 ` Take 2 musb_hdrc cleanup (was: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses) Felipe Balbi
@ 2007-08-15 19:47 ` Hingkwan Huen
1 sibling, 0 replies; 8+ messages in thread
From: Hingkwan Huen @ 2007-08-15 19:47 UTC (permalink / raw)
To: linux-omap-open-source
Hi All,
I am having problem starting u-boot correctly for the OSK5912 whenever
it is connected to an external module on connector A (EMIFS) using the
nCS3. I've tried pulling MPU_BOOT to vcc and GPIO1 to gnd manually but
don't seem to help. Without plugging anything on connector A u-boot
starts correctly and it detects the flash correctly. Any ideas will be
very appreciated.
U-Boot 1.2.0 (Aug 7 2007 - 12:52:58)
CPU: OMAP162123 at 96.0 MHz (DPLL1=96.0 MHz)
Board: OSK5912
DRAM: 32 MB
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
## Unknown FLASH on Bank 2 - Size = 0x00000000 = 0 MB
Flash: 0 kB
In: serial
Out: serial
Err: serial
OMAP5912 OSK #
Thanks,
kwan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-08-15 19:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 14:08 [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses Felipe Balbi
2007-08-15 16:13 ` David Brownell
2007-08-15 16:29 ` Felipe Balbi
2007-08-15 16:44 ` David Brownell
2007-08-15 17:23 ` Take 2 musb_hdrc cleanup (was: [PATCH] MUSB_HDRC: Get rid of pr_*() and printk() clauses) Felipe Balbi
2007-08-15 17:23 ` [PATCH] MUSB_HDRC: Convert printk() to dev_* macros Felipe Balbi
2007-08-15 17:45 ` David Brownell
2007-08-15 19:47 ` OMAP5912 OSK Boot Hingkwan Huen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox