[PATCH 2/5] usb: mtu3: print endpoint type as string
Chunfeng Yun
chunfeng.yun at mediatek.com
Fri Jul 8 00:19:00 PDT 2022
Print endpoint type as string instead of decimal value to make
the log more readable.
Signed-off-by: Chunfeng Yun <chunfeng.yun at mediatek.com>
---
drivers/usb/mtu3/mtu3_debugfs.c | 8 ++++----
drivers/usb/mtu3/mtu3_trace.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/mtu3/mtu3_debugfs.c b/drivers/usb/mtu3/mtu3_debugfs.c
index a6f72494b819..ea9186d5504d 100644
--- a/drivers/usb/mtu3/mtu3_debugfs.c
+++ b/drivers/usb/mtu3/mtu3_debugfs.c
@@ -101,13 +101,13 @@ static int mtu3_ep_used_show(struct seq_file *sf, void *unused)
for (i = 0; i < mtu->num_eps; i++) {
mep = mtu->in_eps + i;
if (mep->flags & MTU3_EP_ENABLED) {
- seq_printf(sf, "%s - type: %d\n", mep->name, mep->type);
+ seq_printf(sf, "%s - type: %s\n", mep->name, usb_ep_type_string(mep->type));
used++;
}
mep = mtu->out_eps + i;
if (mep->flags & MTU3_EP_ENABLED) {
- seq_printf(sf, "%s - type: %d\n", mep->name, mep->type);
+ seq_printf(sf, "%s - type: %s\n", mep->name, usb_ep_type_string(mep->type));
used++;
}
}
@@ -177,8 +177,8 @@ static int mtu3_ep_info_show(struct seq_file *sf, void *unused)
unsigned long flags;
spin_lock_irqsave(&mtu->lock, flags);
- seq_printf(sf, "ep - type:%d, maxp:%d, slot:%d, flags:%x\n",
- mep->type, mep->maxp, mep->slot, mep->flags);
+ seq_printf(sf, "ep - type:%s, maxp:%d, slot:%d, flags:%x\n",
+ usb_ep_type_string(mep->type), mep->maxp, mep->slot, mep->flags);
spin_unlock_irqrestore(&mtu->lock, flags);
return 0;
diff --git a/drivers/usb/mtu3/mtu3_trace.h b/drivers/usb/mtu3/mtu3_trace.h
index 1b897636daf2..a09deae1146f 100644
--- a/drivers/usb/mtu3/mtu3_trace.h
+++ b/drivers/usb/mtu3/mtu3_trace.h
@@ -238,8 +238,8 @@ DECLARE_EVENT_CLASS(mtu3_log_ep,
__entry->direction = mep->is_in;
__entry->gpd_ring = &mep->gpd_ring;
),
- TP_printk("%s: type %d maxp %d slot %d mult %d burst %d ring %p/%pad flags %c:%c%c%c:%c",
- __get_str(name), __entry->type,
+ TP_printk("%s: type %s maxp %d slot %d mult %d burst %d ring %p/%pad flags %c:%c%c%c:%c",
+ __get_str(name), usb_ep_type_string(__entry->type),
__entry->maxp, __entry->slot,
__entry->mult, __entry->maxburst,
__entry->gpd_ring, &__entry->gpd_ring->dma,
--
2.18.0
More information about the Linux-mediatek
mailing list