aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/usblp.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 00:33:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 00:33:31 -0400
commit4f306309fc07075a70f0731805c7db2f075ebcab (patch)
tree6f2c4e718aba620ae2ef0e5b7e3f8de99198e82c /drivers/usb/class/usblp.c
parent4ed48e5e8b308299bfc4bbad6bb008743f40fa5c (diff)
USB: usblp.c: remove dbg() usage
dbg() was a very old USB-specific macro that should no longer be used. This patch removes it from being used in the driver and uses dev_dbg() instead. CC: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class/usblp.c')
-rw-r--r--drivers/usb/class/usblp.c82
1 files changed, 47 insertions, 35 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index a68c1a63dc65..d4c47d5d7625 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -172,27 +172,31 @@ struct usblp {
172#ifdef DEBUG 172#ifdef DEBUG
173static void usblp_dump(struct usblp *usblp) 173static void usblp_dump(struct usblp *usblp)
174{ 174{
175 struct device *dev = &usblp->intf->dev;
175 int p; 176 int p;
176 177
177 dbg("usblp=0x%p", usblp); 178 dev_dbg(dev, "usblp=0x%p\n", usblp);
178 dbg("dev=0x%p", usblp->dev); 179 dev_dbg(dev, "dev=0x%p\n", usblp->dev);
179 dbg("present=%d", usblp->present); 180 dev_dbg(dev, "present=%d\n", usblp->present);
180 dbg("readbuf=0x%p", usblp->readbuf); 181 dev_dbg(dev, "readbuf=0x%p\n", usblp->readbuf);
181 dbg("readcount=%d", usblp->readcount); 182 dev_dbg(dev, "readcount=%d\n", usblp->readcount);
182 dbg("ifnum=%d", usblp->ifnum); 183 dev_dbg(dev, "ifnum=%d\n", usblp->ifnum);
183 for (p = USBLP_FIRST_PROTOCOL; p <= USBLP_LAST_PROTOCOL; p++) { 184 for (p = USBLP_FIRST_PROTOCOL; p <= USBLP_LAST_PROTOCOL; p++) {
184 dbg("protocol[%d].alt_setting=%d", p, usblp->protocol[p].alt_setting); 185 dev_dbg(dev, "protocol[%d].alt_setting=%d\n", p,
185 dbg("protocol[%d].epwrite=%p", p, usblp->protocol[p].epwrite); 186 usblp->protocol[p].alt_setting);
186 dbg("protocol[%d].epread=%p", p, usblp->protocol[p].epread); 187 dev_dbg(dev, "protocol[%d].epwrite=%p\n", p,
187 } 188 usblp->protocol[p].epwrite);
188 dbg("current_protocol=%d", usblp->current_protocol); 189 dev_dbg(dev, "protocol[%d].epread=%p\n", p,
189 dbg("minor=%d", usblp->minor); 190 usblp->protocol[p].epread);
190 dbg("wstatus=%d", usblp->wstatus); 191 }
191 dbg("rstatus=%d", usblp->rstatus); 192 dev_dbg(dev, "current_protocol=%d\n", usblp->current_protocol);
192 dbg("quirks=%d", usblp->quirks); 193 dev_dbg(dev, "minor=%d\n", usblp->minor);
193 dbg("used=%d", usblp->used); 194 dev_dbg(dev, "wstatus=%d\n", usblp->wstatus);
194 dbg("bidir=%d", usblp->bidir); 195 dev_dbg(dev, "rstatus=%d\n", usblp->rstatus);
195 dbg("device_id_string=\"%s\"", 196 dev_dbg(dev, "quirks=%d\n", usblp->quirks);
197 dev_dbg(dev, "used=%d\n", usblp->used);
198 dev_dbg(dev, "bidir=%d\n", usblp->bidir);
199 dev_dbg(dev, "device_id_string=\"%s\"\n",
196 usblp->device_id_string ? 200 usblp->device_id_string ?
197 usblp->device_id_string + 2 : 201 usblp->device_id_string + 2 :
198 (unsigned char *)"(null)"); 202 (unsigned char *)"(null)");
@@ -262,7 +266,8 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i
262 retval = usb_control_msg(usblp->dev, 266 retval = usb_control_msg(usblp->dev,
263 dir ? usb_rcvctrlpipe(usblp->dev, 0) : usb_sndctrlpipe(usblp->dev, 0), 267 dir ? usb_rcvctrlpipe(usblp->dev, 0) : usb_sndctrlpipe(usblp->dev, 0),
264 request, type | dir | recip, value, index, buf, len, USBLP_CTL_TIMEOUT); 268 request, type | dir | recip, value, index, buf, len, USBLP_CTL_TIMEOUT);
265 dbg("usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d", 269 dev_dbg(&usblp->intf->dev,
270 "usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d\n",
266 request, !!dir, recip, value, index, len, retval); 271 request, !!dir, recip, value, index, len, retval);
267 return retval < 0 ? retval : 0; 272 return retval < 0 ? retval : 0;
268} 273}
@@ -500,8 +505,9 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
500 goto done; 505 goto done;
501 } 506 }
502 507
503 dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd), 508 dev_dbg(&usblp->intf->dev,
504 _IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd)); 509 "usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)\n", cmd,
510 _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd));
505 511
506 if (_IOC_TYPE(cmd) == 'P') /* new-style ioctl number */ 512 if (_IOC_TYPE(cmd) == 'P') /* new-style ioctl number */
507 513
@@ -594,7 +600,8 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
594 goto done; 600 goto done;
595 } 601 }
596 602
597 dbg("usblp%d requested/got HP channel %ld/%d", 603 dev_dbg(&usblp->intf->dev,
604 "usblp%d requested/got HP channel %ld/%d\n",
598 usblp->minor, arg, newChannel); 605 usblp->minor, arg, newChannel);
599 break; 606 break;
600 607
@@ -614,7 +621,8 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
614 goto done; 621 goto done;
615 } 622 }
616 623
617 dbg("usblp%d is bus=%d, device=%d", 624 dev_dbg(&usblp->intf->dev,
625 "usblp%d is bus=%d, device=%d\n",
618 usblp->minor, twoints[0], twoints[1]); 626 usblp->minor, twoints[0], twoints[1]);
619 break; 627 break;
620 628
@@ -634,7 +642,8 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
634 goto done; 642 goto done;
635 } 643 }
636 644
637 dbg("usblp%d is VID=0x%4.4X, PID=0x%4.4X", 645 dev_dbg(&usblp->intf->dev,
646 "usblp%d is VID=0x%4.4X, PID=0x%4.4X\n",
638 usblp->minor, twoints[0], twoints[1]); 647 usblp->minor, twoints[0], twoints[1]);
639 break; 648 break;
640 649
@@ -987,7 +996,7 @@ static int usblp_submit_read(struct usblp *usblp)
987 usblp->rcomplete = 0; 996 usblp->rcomplete = 0;
988 spin_unlock_irqrestore(&usblp->lock, flags); 997 spin_unlock_irqrestore(&usblp->lock, flags);
989 if ((rc = usb_submit_urb(urb, GFP_KERNEL)) < 0) { 998 if ((rc = usb_submit_urb(urb, GFP_KERNEL)) < 0) {
990 dbg("error submitting urb (%d)", rc); 999 dev_dbg(&usblp->intf->dev, "error submitting urb (%d)\n", rc);
991 spin_lock_irqsave(&usblp->lock, flags); 1000 spin_lock_irqsave(&usblp->lock, flags);
992 usblp->rstatus = rc; 1001 usblp->rstatus = rc;
993 usblp->rcomplete = 1; 1002 usblp->rcomplete = 1;
@@ -1129,7 +1138,8 @@ static int usblp_probe(struct usb_interface *intf,
1129 /* Analyze and pick initial alternate settings and endpoints. */ 1138 /* Analyze and pick initial alternate settings and endpoints. */
1130 protocol = usblp_select_alts(usblp); 1139 protocol = usblp_select_alts(usblp);
1131 if (protocol < 0) { 1140 if (protocol < 0) {
1132 dbg("incompatible printer-class device 0x%4.4X/0x%4.4X", 1141 dev_dbg(&intf->dev,
1142 "incompatible printer-class device 0x%4.4X/0x%4.4X\n",
1133 le16_to_cpu(dev->descriptor.idVendor), 1143 le16_to_cpu(dev->descriptor.idVendor),
1134 le16_to_cpu(dev->descriptor.idProduct)); 1144 le16_to_cpu(dev->descriptor.idProduct));
1135 retval = -ENODEV; 1145 retval = -ENODEV;
@@ -1158,14 +1168,14 @@ static int usblp_probe(struct usb_interface *intf,
1158 1168
1159 retval = usb_register_dev(intf, &usblp_class); 1169 retval = usb_register_dev(intf, &usblp_class);
1160 if (retval) { 1170 if (retval) {
1161 printk(KERN_ERR "usblp: Not able to get a minor" 1171 dev_err(&intf->dev,
1162 " (base %u, slice default): %d\n", 1172 "usblp: Not able to get a minor (base %u, slice default): %d\n",
1163 USBLP_MINOR_BASE, retval); 1173 USBLP_MINOR_BASE, retval);
1164 goto abort_intfdata; 1174 goto abort_intfdata;
1165 } 1175 }
1166 usblp->minor = intf->minor; 1176 usblp->minor = intf->minor;
1167 printk(KERN_INFO "usblp%d: USB %sdirectional printer dev %d " 1177 dev_info(&intf->dev,
1168 "if %d alt %d proto %d vid 0x%4.4X pid 0x%4.4X\n", 1178 "usblp%d: USB %sdirectional printer dev %d if %d alt %d proto %d vid 0x%4.4X pid 0x%4.4X\n",
1169 usblp->minor, usblp->bidir ? "Bi" : "Uni", dev->devnum, 1179 usblp->minor, usblp->bidir ? "Bi" : "Uni", dev->devnum,
1170 usblp->ifnum, 1180 usblp->ifnum,
1171 usblp->protocol[usblp->current_protocol].alt_setting, 1181 usblp->protocol[usblp->current_protocol].alt_setting,
@@ -1302,7 +1312,8 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol)
1302 1312
1303 usblp->bidir = (usblp->protocol[protocol].epread != NULL); 1313 usblp->bidir = (usblp->protocol[protocol].epread != NULL);
1304 usblp->current_protocol = protocol; 1314 usblp->current_protocol = protocol;
1305 dbg("usblp%d set protocol %d", usblp->minor, protocol); 1315 dev_dbg(&usblp->intf->dev, "usblp%d set protocol %d\n",
1316 usblp->minor, protocol);
1306 return 0; 1317 return 0;
1307} 1318}
1308 1319
@@ -1315,7 +1326,8 @@ static int usblp_cache_device_id_string(struct usblp *usblp)
1315 1326
1316 err = usblp_get_id(usblp, 0, usblp->device_id_string, USBLP_DEVICE_ID_SIZE - 1); 1327 err = usblp_get_id(usblp, 0, usblp->device_id_string, USBLP_DEVICE_ID_SIZE - 1);
1317 if (err < 0) { 1328 if (err < 0) {
1318 dbg("usblp%d: error = %d reading IEEE-1284 Device ID string", 1329 dev_dbg(&usblp->intf->dev,
1330 "usblp%d: error = %d reading IEEE-1284 Device ID string\n",
1319 usblp->minor, err); 1331 usblp->minor, err);
1320 usblp->device_id_string[0] = usblp->device_id_string[1] = '\0'; 1332 usblp->device_id_string[0] = usblp->device_id_string[1] = '\0';
1321 return -EIO; 1333 return -EIO;
@@ -1331,7 +1343,7 @@ static int usblp_cache_device_id_string(struct usblp *usblp)
1331 length = USBLP_DEVICE_ID_SIZE - 1; 1343 length = USBLP_DEVICE_ID_SIZE - 1;
1332 usblp->device_id_string[length] = '\0'; 1344 usblp->device_id_string[length] = '\0';
1333 1345
1334 dbg("usblp%d Device ID string [len=%d]=\"%s\"", 1346 dev_dbg(&usblp->intf->dev, "usblp%d Device ID string [len=%d]=\"%s\"\n",
1335 usblp->minor, length, &usblp->device_id_string[2]); 1347 usblp->minor, length, &usblp->device_id_string[2]);
1336 1348
1337 return length; 1349 return length;