提交 9f857ae9 编写于 作者: G Greg Kroah-Hartman

USB: ir-usb.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the ir-usb.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Johan Hovold <jhovold@gmail.com>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f73e1ffa
...@@ -96,18 +96,21 @@ static struct usb_serial_driver * const serial_drivers[] = { ...@@ -96,18 +96,21 @@ static struct usb_serial_driver * const serial_drivers[] = {
&ir_device, NULL &ir_device, NULL
}; };
static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc) static inline void irda_usb_dump_class_desc(struct usb_serial *serial,
struct usb_irda_cs_descriptor *desc)
{ {
dbg("bLength=%x", desc->bLength); struct device *dev = &serial->dev->dev;
dbg("bDescriptorType=%x", desc->bDescriptorType);
dbg("bcdSpecRevision=%x", __le16_to_cpu(desc->bcdSpecRevision)); dev_dbg(dev, "bLength=%x\n", desc->bLength);
dbg("bmDataSize=%x", desc->bmDataSize); dev_dbg(dev, "bDescriptorType=%x\n", desc->bDescriptorType);
dbg("bmWindowSize=%x", desc->bmWindowSize); dev_dbg(dev, "bcdSpecRevision=%x\n", __le16_to_cpu(desc->bcdSpecRevision));
dbg("bmMinTurnaroundTime=%d", desc->bmMinTurnaroundTime); dev_dbg(dev, "bmDataSize=%x\n", desc->bmDataSize);
dbg("wBaudRate=%x", __le16_to_cpu(desc->wBaudRate)); dev_dbg(dev, "bmWindowSize=%x\n", desc->bmWindowSize);
dbg("bmAdditionalBOFs=%x", desc->bmAdditionalBOFs); dev_dbg(dev, "bmMinTurnaroundTime=%d\n", desc->bmMinTurnaroundTime);
dbg("bIrdaRateSniff=%x", desc->bIrdaRateSniff); dev_dbg(dev, "wBaudRate=%x\n", __le16_to_cpu(desc->wBaudRate));
dbg("bMaxUnicastList=%x", desc->bMaxUnicastList); dev_dbg(dev, "bmAdditionalBOFs=%x\n", desc->bmAdditionalBOFs);
dev_dbg(dev, "bIrdaRateSniff=%x\n", desc->bIrdaRateSniff);
dev_dbg(dev, "bMaxUnicastList=%x\n", desc->bMaxUnicastList);
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
...@@ -123,8 +126,9 @@ static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc) ...@@ -123,8 +126,9 @@ static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc)
* Based on the same function in drivers/net/irda/irda-usb.c * Based on the same function in drivers/net/irda/irda-usb.c
*/ */
static struct usb_irda_cs_descriptor * static struct usb_irda_cs_descriptor *
irda_usb_find_class_desc(struct usb_device *dev, unsigned int ifnum) irda_usb_find_class_desc(struct usb_serial *serial, unsigned int ifnum)
{ {
struct usb_device *dev = serial->dev;
struct usb_irda_cs_descriptor *desc; struct usb_irda_cs_descriptor *desc;
int ret; int ret;
...@@ -137,20 +141,20 @@ irda_usb_find_class_desc(struct usb_device *dev, unsigned int ifnum) ...@@ -137,20 +141,20 @@ irda_usb_find_class_desc(struct usb_device *dev, unsigned int ifnum)
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
0, ifnum, desc, sizeof(*desc), 1000); 0, ifnum, desc, sizeof(*desc), 1000);
dbg("%s - ret=%d", __func__, ret); dev_dbg(&serial->dev->dev, "%s - ret=%d\n", __func__, ret);
if (ret < sizeof(*desc)) { if (ret < sizeof(*desc)) {
dbg("%s - class descriptor read %s (%d)", dev_dbg(&serial->dev->dev,
__func__, "%s - class descriptor read %s (%d)\n", __func__,
(ret < 0) ? "failed" : "too short", (ret < 0) ? "failed" : "too short", ret);
ret);
goto error; goto error;
} }
if (desc->bDescriptorType != USB_DT_CS_IRDA) { if (desc->bDescriptorType != USB_DT_CS_IRDA) {
dbg("%s - bad class descriptor type", __func__); dev_dbg(&serial->dev->dev, "%s - bad class descriptor type\n",
__func__);
goto error; goto error;
} }
irda_usb_dump_class_desc(desc); irda_usb_dump_class_desc(serial, desc);
return desc; return desc;
error: error:
...@@ -200,14 +204,15 @@ static int ir_startup(struct usb_serial *serial) ...@@ -200,14 +204,15 @@ static int ir_startup(struct usb_serial *serial)
{ {
struct usb_irda_cs_descriptor *irda_desc; struct usb_irda_cs_descriptor *irda_desc;
irda_desc = irda_usb_find_class_desc(serial->dev, 0); irda_desc = irda_usb_find_class_desc(serial, 0);
if (!irda_desc) { if (!irda_desc) {
dev_err(&serial->dev->dev, dev_err(&serial->dev->dev,
"IRDA class descriptor not found, device not bound\n"); "IRDA class descriptor not found, device not bound\n");
return -ENODEV; return -ENODEV;
} }
dbg("%s - Baud rates supported:%s%s%s%s%s%s%s%s%s", dev_dbg(&serial->dev->dev,
"%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n",
__func__, __func__,
(irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "", (irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "",
(irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "", (irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "",
...@@ -316,7 +321,8 @@ static void ir_set_termios_callback(struct urb *urb) ...@@ -316,7 +321,8 @@ static void ir_set_termios_callback(struct urb *urb)
kfree(urb->transfer_buffer); kfree(urb->transfer_buffer);
if (urb->status) if (urb->status)
dbg("%s - non-zero urb status: %d", __func__, urb->status); dev_dbg(&urb->dev->dev, "%s - non-zero urb status: %d\n",
__func__, urb->status);
} }
static void ir_set_termios(struct tty_struct *tty, static void ir_set_termios(struct tty_struct *tty,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册