aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-03-03 19:08:34 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:55 -0400
commit441b62c1edb986827154768d89bbac0ba779984f (patch)
tree13724c22d1b190a36f0ddbba38554e6c66bea6af /drivers/usb/serial/ftdi_sio.c
parent14722ef4acedc643f0b78b7165ceff2d300dae4d (diff)
USB: replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c156
1 files changed, 78 insertions, 78 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 54b502f2924c..8b531b377dcb 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -525,7 +525,7 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, unsigned
525 int rv; 525 int rv;
526 526
527 if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { 527 if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) {
528 dbg("%s - DTR|RTS not being set|cleared", __FUNCTION__); 528 dbg("%s - DTR|RTS not being set|cleared", __func__);
529 return 0; /* no change */ 529 return 0; /* no change */
530 } 530 }
531 531
@@ -553,13 +553,13 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, unsigned
553 kfree(buf); 553 kfree(buf);
554 if (rv < 0) { 554 if (rv < 0) {
555 err("%s Error from MODEM_CTRL urb: DTR %s, RTS %s", 555 err("%s Error from MODEM_CTRL urb: DTR %s, RTS %s",
556 __FUNCTION__, 556 __func__,
557 (set & TIOCM_DTR) ? "HIGH" : 557 (set & TIOCM_DTR) ? "HIGH" :
558 (clear & TIOCM_DTR) ? "LOW" : "unchanged", 558 (clear & TIOCM_DTR) ? "LOW" : "unchanged",
559 (set & TIOCM_RTS) ? "HIGH" : 559 (set & TIOCM_RTS) ? "HIGH" :
560 (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 560 (clear & TIOCM_RTS) ? "LOW" : "unchanged");
561 } else { 561 } else {
562 dbg("%s - DTR %s, RTS %s", __FUNCTION__, 562 dbg("%s - DTR %s, RTS %s", __func__,
563 (set & TIOCM_DTR) ? "HIGH" : 563 (set & TIOCM_DTR) ? "HIGH" :
564 (clear & TIOCM_DTR) ? "LOW" : "unchanged", 564 (clear & TIOCM_DTR) ? "LOW" : "unchanged",
565 (set & TIOCM_RTS) ? "HIGH" : 565 (set & TIOCM_RTS) ? "HIGH" :
@@ -639,7 +639,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
639 /* 1. Get the baud rate from the tty settings, this observes alt_speed hack */ 639 /* 1. Get the baud rate from the tty settings, this observes alt_speed hack */
640 640
641 baud = tty_get_baud_rate(port->tty); 641 baud = tty_get_baud_rate(port->tty);
642 dbg("%s - tty_get_baud_rate reports speed %d", __FUNCTION__, baud); 642 dbg("%s - tty_get_baud_rate reports speed %d", __func__, baud);
643 643
644 /* 2. Observe async-compatible custom_divisor hack, update baudrate if needed */ 644 /* 2. Observe async-compatible custom_divisor hack, update baudrate if needed */
645 645
@@ -647,7 +647,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
647 ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 647 ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) &&
648 (priv->custom_divisor)) { 648 (priv->custom_divisor)) {
649 baud = priv->baud_base / priv->custom_divisor; 649 baud = priv->baud_base / priv->custom_divisor;
650 dbg("%s - custom divisor %d sets baud rate to %d", __FUNCTION__, priv->custom_divisor, baud); 650 dbg("%s - custom divisor %d sets baud rate to %d", __func__, priv->custom_divisor, baud);
651 } 651 }
652 652
653 /* 3. Convert baudrate to device-specific divisor */ 653 /* 3. Convert baudrate to device-specific divisor */
@@ -668,7 +668,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
668 case 115200: div_value = ftdi_sio_b115200; break; 668 case 115200: div_value = ftdi_sio_b115200; break;
669 } /* baud */ 669 } /* baud */
670 if (div_value == 0) { 670 if (div_value == 0) {
671 dbg("%s - Baudrate (%d) requested is not supported", __FUNCTION__, baud); 671 dbg("%s - Baudrate (%d) requested is not supported", __func__, baud);
672 div_value = ftdi_sio_b9600; 672 div_value = ftdi_sio_b9600;
673 baud = 9600; 673 baud = 9600;
674 div_okay = 0; 674 div_okay = 0;
@@ -678,7 +678,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
678 if (baud <= 3000000) { 678 if (baud <= 3000000) {
679 div_value = ftdi_232am_baud_to_divisor(baud); 679 div_value = ftdi_232am_baud_to_divisor(baud);
680 } else { 680 } else {
681 dbg("%s - Baud rate too high!", __FUNCTION__); 681 dbg("%s - Baud rate too high!", __func__);
682 baud = 9600; 682 baud = 9600;
683 div_value = ftdi_232am_baud_to_divisor(9600); 683 div_value = ftdi_232am_baud_to_divisor(9600);
684 div_okay = 0; 684 div_okay = 0;
@@ -690,7 +690,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
690 if (baud <= 3000000) { 690 if (baud <= 3000000) {
691 div_value = ftdi_232bm_baud_to_divisor(baud); 691 div_value = ftdi_232bm_baud_to_divisor(baud);
692 } else { 692 } else {
693 dbg("%s - Baud rate too high!", __FUNCTION__); 693 dbg("%s - Baud rate too high!", __func__);
694 div_value = ftdi_232bm_baud_to_divisor(9600); 694 div_value = ftdi_232bm_baud_to_divisor(9600);
695 div_okay = 0; 695 div_okay = 0;
696 baud = 9600; 696 baud = 9600;
@@ -700,7 +700,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
700 700
701 if (div_okay) { 701 if (div_okay) {
702 dbg("%s - Baud rate set to %d (divisor 0x%lX) on chip %s", 702 dbg("%s - Baud rate set to %d (divisor 0x%lX) on chip %s",
703 __FUNCTION__, baud, (unsigned long)div_value, 703 __func__, baud, (unsigned long)div_value,
704 ftdi_chip_name[priv->chip_type]); 704 ftdi_chip_name[priv->chip_type]);
705 } 705 }
706 706
@@ -801,7 +801,7 @@ static void ftdi_determine_type(struct usb_serial_port *port)
801 801
802 version = le16_to_cpu(udev->descriptor.bcdDevice); 802 version = le16_to_cpu(udev->descriptor.bcdDevice);
803 interfaces = udev->actconfig->desc.bNumInterfaces; 803 interfaces = udev->actconfig->desc.bNumInterfaces;
804 dbg("%s: bcdDevice = 0x%x, bNumInterfaces = %u", __FUNCTION__, 804 dbg("%s: bcdDevice = 0x%x, bNumInterfaces = %u", __func__,
805 version, interfaces); 805 version, interfaces);
806 if (interfaces > 1) { 806 if (interfaces > 1) {
807 int inter; 807 int inter;
@@ -819,7 +819,7 @@ static void ftdi_determine_type(struct usb_serial_port *port)
819 * to 0x200 when iSerialNumber is 0. */ 819 * to 0x200 when iSerialNumber is 0. */
820 if (version < 0x500) { 820 if (version < 0x500) {
821 dbg("%s: something fishy - bcdDevice too low for multi-interface device", 821 dbg("%s: something fishy - bcdDevice too low for multi-interface device",
822 __FUNCTION__); 822 __func__);
823 } 823 }
824 } else if (version < 0x200) { 824 } else if (version < 0x200) {
825 /* Old device. Assume its the original SIO. */ 825 /* Old device. Assume its the original SIO. */
@@ -857,7 +857,7 @@ static ssize_t show_latency_timer(struct device *dev, struct device_attribute *a
857 int rv = 0; 857 int rv = 0;
858 858
859 859
860 dbg("%s",__FUNCTION__); 860 dbg("%s",__func__);
861 861
862 rv = usb_control_msg(udev, 862 rv = usb_control_msg(udev,
863 usb_rcvctrlpipe(udev, 0), 863 usb_rcvctrlpipe(udev, 0),
@@ -884,7 +884,7 @@ static ssize_t store_latency_timer(struct device *dev, struct device_attribute *
884 int v = simple_strtoul(valbuf, NULL, 10); 884 int v = simple_strtoul(valbuf, NULL, 10);
885 int rv = 0; 885 int rv = 0;
886 886
887 dbg("%s: setting latency timer = %i", __FUNCTION__, v); 887 dbg("%s: setting latency timer = %i", __func__, v);
888 888
889 rv = usb_control_msg(udev, 889 rv = usb_control_msg(udev,
890 usb_sndctrlpipe(udev, 0), 890 usb_sndctrlpipe(udev, 0),
@@ -913,7 +913,7 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att
913 int v = simple_strtoul(valbuf, NULL, 10); 913 int v = simple_strtoul(valbuf, NULL, 10);
914 int rv = 0; 914 int rv = 0;
915 915
916 dbg("%s: setting event char = %i", __FUNCTION__, v); 916 dbg("%s: setting event char = %i", __func__, v);
917 917
918 rv = usb_control_msg(udev, 918 rv = usb_control_msg(udev,
919 usb_sndctrlpipe(udev, 0), 919 usb_sndctrlpipe(udev, 0),
@@ -938,7 +938,7 @@ static int create_sysfs_attrs(struct usb_serial_port *port)
938 struct ftdi_private *priv = usb_get_serial_port_data(port); 938 struct ftdi_private *priv = usb_get_serial_port_data(port);
939 int retval = 0; 939 int retval = 0;
940 940
941 dbg("%s",__FUNCTION__); 941 dbg("%s",__func__);
942 942
943 /* XXX I've no idea if the original SIO supports the event_char 943 /* XXX I've no idea if the original SIO supports the event_char
944 * sysfs parameter, so I'm playing it safe. */ 944 * sysfs parameter, so I'm playing it safe. */
@@ -960,7 +960,7 @@ static void remove_sysfs_attrs(struct usb_serial_port *port)
960{ 960{
961 struct ftdi_private *priv = usb_get_serial_port_data(port); 961 struct ftdi_private *priv = usb_get_serial_port_data(port);
962 962
963 dbg("%s",__FUNCTION__); 963 dbg("%s",__func__);
964 964
965 /* XXX see create_sysfs_attrs */ 965 /* XXX see create_sysfs_attrs */
966 if (priv->chip_type != SIO) { 966 if (priv->chip_type != SIO) {
@@ -1002,11 +1002,11 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
1002 struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial); 1002 struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial);
1003 1003
1004 1004
1005 dbg("%s",__FUNCTION__); 1005 dbg("%s",__func__);
1006 1006
1007 priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); 1007 priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL);
1008 if (!priv){ 1008 if (!priv){
1009 err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct ftdi_private)); 1009 err("%s- kmalloc(%Zd) failed.", __func__, sizeof(struct ftdi_private));
1010 return -ENOMEM; 1010 return -ENOMEM;
1011 } 1011 }
1012 1012
@@ -1055,7 +1055,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
1055/* Called from usbserial:serial_probe */ 1055/* Called from usbserial:serial_probe */
1056static void ftdi_USB_UIRT_setup (struct ftdi_private *priv) 1056static void ftdi_USB_UIRT_setup (struct ftdi_private *priv)
1057{ 1057{
1058 dbg("%s",__FUNCTION__); 1058 dbg("%s",__func__);
1059 1059
1060 priv->flags |= ASYNC_SPD_CUST; 1060 priv->flags |= ASYNC_SPD_CUST;
1061 priv->custom_divisor = 77; 1061 priv->custom_divisor = 77;
@@ -1066,7 +1066,7 @@ static void ftdi_USB_UIRT_setup (struct ftdi_private *priv)
1066 * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */ 1066 * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */
1067static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv) 1067static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv)
1068{ 1068{
1069 dbg("%s",__FUNCTION__); 1069 dbg("%s",__func__);
1070 1070
1071 priv->flags |= ASYNC_SPD_CUST; 1071 priv->flags |= ASYNC_SPD_CUST;
1072 priv->custom_divisor = 240; 1072 priv->custom_divisor = 240;
@@ -1084,7 +1084,7 @@ static int ftdi_jtag_probe(struct usb_serial *serial)
1084 struct usb_device *udev = serial->dev; 1084 struct usb_device *udev = serial->dev;
1085 struct usb_interface *interface = serial->interface; 1085 struct usb_interface *interface = serial->interface;
1086 1086
1087 dbg("%s",__FUNCTION__); 1087 dbg("%s",__func__);
1088 1088
1089 if (interface == udev->actconfig->interface[0]) { 1089 if (interface == udev->actconfig->interface[0]) {
1090 info("Ignoring serial port reserved for JTAG"); 1090 info("Ignoring serial port reserved for JTAG");
@@ -1120,14 +1120,14 @@ static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)
1120 */ 1120 */
1121static void ftdi_shutdown (struct usb_serial *serial) 1121static void ftdi_shutdown (struct usb_serial *serial)
1122{ 1122{
1123 dbg("%s", __FUNCTION__); 1123 dbg("%s", __func__);
1124} 1124}
1125 1125
1126static int ftdi_sio_port_remove(struct usb_serial_port *port) 1126static int ftdi_sio_port_remove(struct usb_serial_port *port)
1127{ 1127{
1128 struct ftdi_private *priv = usb_get_serial_port_data(port); 1128 struct ftdi_private *priv = usb_get_serial_port_data(port);
1129 1129
1130 dbg("%s", __FUNCTION__); 1130 dbg("%s", __func__);
1131 1131
1132 remove_sysfs_attrs(port); 1132 remove_sysfs_attrs(port);
1133 1133
@@ -1152,7 +1152,7 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp)
1152 int result = 0; 1152 int result = 0;
1153 char buf[1]; /* Needed for the usb_control_msg I think */ 1153 char buf[1]; /* Needed for the usb_control_msg I think */
1154 1154
1155 dbg("%s", __FUNCTION__); 1155 dbg("%s", __func__);
1156 1156
1157 spin_lock_irqsave(&priv->tx_lock, flags); 1157 spin_lock_irqsave(&priv->tx_lock, flags);
1158 priv->tx_bytes = 0; 1158 priv->tx_bytes = 0;
@@ -1197,7 +1197,7 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp)
1197 ftdi_read_bulk_callback, port); 1197 ftdi_read_bulk_callback, port);
1198 result = usb_submit_urb(port->read_urb, GFP_KERNEL); 1198 result = usb_submit_urb(port->read_urb, GFP_KERNEL);
1199 if (result) 1199 if (result)
1200 err("%s - failed submitting read urb, error %d", __FUNCTION__, result); 1200 err("%s - failed submitting read urb, error %d", __func__, result);
1201 1201
1202 1202
1203 return result; 1203 return result;
@@ -1219,7 +1219,7 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
1219 struct ftdi_private *priv = usb_get_serial_port_data(port); 1219 struct ftdi_private *priv = usb_get_serial_port_data(port);
1220 char buf[1]; 1220 char buf[1];
1221 1221
1222 dbg("%s", __FUNCTION__); 1222 dbg("%s", __func__);
1223 1223
1224 mutex_lock(&port->serial->disc_mutex); 1224 mutex_lock(&port->serial->disc_mutex);
1225 if (c_cflag & HUPCL && !port->serial->disconnected){ 1225 if (c_cflag & HUPCL && !port->serial->disconnected){
@@ -1266,7 +1266,7 @@ static int ftdi_write (struct usb_serial_port *port,
1266 int transfer_size; 1266 int transfer_size;
1267 unsigned long flags; 1267 unsigned long flags;
1268 1268
1269 dbg("%s port %d, %d bytes", __FUNCTION__, port->number, count); 1269 dbg("%s port %d, %d bytes", __func__, port->number, count);
1270 1270
1271 if (count == 0) { 1271 if (count == 0) {
1272 dbg("write request of 0 bytes"); 1272 dbg("write request of 0 bytes");
@@ -1275,7 +1275,7 @@ static int ftdi_write (struct usb_serial_port *port,
1275 spin_lock_irqsave(&priv->tx_lock, flags); 1275 spin_lock_irqsave(&priv->tx_lock, flags);
1276 if (priv->tx_outstanding_urbs > URB_UPPER_LIMIT) { 1276 if (priv->tx_outstanding_urbs > URB_UPPER_LIMIT) {
1277 spin_unlock_irqrestore(&priv->tx_lock, flags); 1277 spin_unlock_irqrestore(&priv->tx_lock, flags);
1278 dbg("%s - write limit hit\n", __FUNCTION__); 1278 dbg("%s - write limit hit\n", __func__);
1279 return 0; 1279 return 0;
1280 } 1280 }
1281 priv->tx_outstanding_urbs++; 1281 priv->tx_outstanding_urbs++;
@@ -1295,14 +1295,14 @@ static int ftdi_write (struct usb_serial_port *port,
1295 1295
1296 buffer = kmalloc (transfer_size, GFP_ATOMIC); 1296 buffer = kmalloc (transfer_size, GFP_ATOMIC);
1297 if (!buffer) { 1297 if (!buffer) {
1298 err("%s ran out of kernel memory for urb ...", __FUNCTION__); 1298 err("%s ran out of kernel memory for urb ...", __func__);
1299 count = -ENOMEM; 1299 count = -ENOMEM;
1300 goto error_no_buffer; 1300 goto error_no_buffer;
1301 } 1301 }
1302 1302
1303 urb = usb_alloc_urb(0, GFP_ATOMIC); 1303 urb = usb_alloc_urb(0, GFP_ATOMIC);
1304 if (!urb) { 1304 if (!urb) {
1305 err("%s - no more free urbs", __FUNCTION__); 1305 err("%s - no more free urbs", __func__);
1306 count = -ENOMEM; 1306 count = -ENOMEM;
1307 goto error_no_urb; 1307 goto error_no_urb;
1308 } 1308 }
@@ -1334,7 +1334,7 @@ static int ftdi_write (struct usb_serial_port *port,
1334 memcpy (buffer, buf, count); 1334 memcpy (buffer, buf, count);
1335 } 1335 }
1336 1336
1337 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, transfer_size, buffer); 1337 usb_serial_debug_data(debug, &port->dev, __func__, transfer_size, buffer);
1338 1338
1339 /* fill the buffer and send it */ 1339 /* fill the buffer and send it */
1340 usb_fill_bulk_urb(urb, port->serial->dev, 1340 usb_fill_bulk_urb(urb, port->serial->dev,
@@ -1344,7 +1344,7 @@ static int ftdi_write (struct usb_serial_port *port,
1344 1344
1345 status = usb_submit_urb(urb, GFP_ATOMIC); 1345 status = usb_submit_urb(urb, GFP_ATOMIC);
1346 if (status) { 1346 if (status) {
1347 err("%s - failed submitting write urb, error %d", __FUNCTION__, status); 1347 err("%s - failed submitting write urb, error %d", __func__, status);
1348 count = status; 1348 count = status;
1349 goto error; 1349 goto error;
1350 } else { 1350 } else {
@@ -1358,7 +1358,7 @@ static int ftdi_write (struct usb_serial_port *port,
1358 * really free it when it is finished with it */ 1358 * really free it when it is finished with it */
1359 usb_free_urb(urb); 1359 usb_free_urb(urb);
1360 1360
1361 dbg("%s write returning: %d", __FUNCTION__, count); 1361 dbg("%s write returning: %d", __func__, count);
1362 return count; 1362 return count;
1363error: 1363error:
1364 usb_free_urb(urb); 1364 usb_free_urb(urb);
@@ -1386,7 +1386,7 @@ static void ftdi_write_bulk_callback (struct urb *urb)
1386 /* free up the transfer buffer, as usb_free_urb() does not do this */ 1386 /* free up the transfer buffer, as usb_free_urb() does not do this */
1387 kfree (urb->transfer_buffer); 1387 kfree (urb->transfer_buffer);
1388 1388
1389 dbg("%s - port %d", __FUNCTION__, port->number); 1389 dbg("%s - port %d", __func__, port->number);
1390 1390
1391 if (status) { 1391 if (status) {
1392 dbg("nonzero write bulk status received: %d", status); 1392 dbg("nonzero write bulk status received: %d", status);
@@ -1395,7 +1395,7 @@ static void ftdi_write_bulk_callback (struct urb *urb)
1395 1395
1396 priv = usb_get_serial_port_data(port); 1396 priv = usb_get_serial_port_data(port);
1397 if (!priv) { 1397 if (!priv) {
1398 dbg("%s - bad port private data pointer - exiting", __FUNCTION__); 1398 dbg("%s - bad port private data pointer - exiting", __func__);
1399 return; 1399 return;
1400 } 1400 }
1401 /* account for transferred data */ 1401 /* account for transferred data */
@@ -1420,7 +1420,7 @@ static int ftdi_write_room( struct usb_serial_port *port )
1420 int room; 1420 int room;
1421 unsigned long flags; 1421 unsigned long flags;
1422 1422
1423 dbg("%s - port %d", __FUNCTION__, port->number); 1423 dbg("%s - port %d", __func__, port->number);
1424 1424
1425 spin_lock_irqsave(&priv->tx_lock, flags); 1425 spin_lock_irqsave(&priv->tx_lock, flags);
1426 if (priv->tx_outstanding_urbs < URB_UPPER_LIMIT) { 1426 if (priv->tx_outstanding_urbs < URB_UPPER_LIMIT) {
@@ -1444,13 +1444,13 @@ static int ftdi_chars_in_buffer (struct usb_serial_port *port)
1444 int buffered; 1444 int buffered;
1445 unsigned long flags; 1445 unsigned long flags;
1446 1446
1447 dbg("%s - port %d", __FUNCTION__, port->number); 1447 dbg("%s - port %d", __func__, port->number);
1448 1448
1449 spin_lock_irqsave(&priv->tx_lock, flags); 1449 spin_lock_irqsave(&priv->tx_lock, flags);
1450 buffered = (int)priv->tx_outstanding_bytes; 1450 buffered = (int)priv->tx_outstanding_bytes;
1451 spin_unlock_irqrestore(&priv->tx_lock, flags); 1451 spin_unlock_irqrestore(&priv->tx_lock, flags);
1452 if (buffered < 0) { 1452 if (buffered < 0) {
1453 err("%s outstanding tx bytes is negative!", __FUNCTION__); 1453 err("%s outstanding tx bytes is negative!", __func__);
1454 buffered = 0; 1454 buffered = 0;
1455 } 1455 }
1456 return buffered; 1456 return buffered;
@@ -1468,30 +1468,30 @@ static void ftdi_read_bulk_callback (struct urb *urb)
1468 int status = urb->status; 1468 int status = urb->status;
1469 1469
1470 if (urb->number_of_packets > 0) { 1470 if (urb->number_of_packets > 0) {
1471 err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__, 1471 err("%s transfer_buffer_length %d actual_length %d number of packets %d",__func__,
1472 urb->transfer_buffer_length, urb->actual_length, urb->number_of_packets ); 1472 urb->transfer_buffer_length, urb->actual_length, urb->number_of_packets );
1473 err("%s transfer_flags %x ", __FUNCTION__,urb->transfer_flags ); 1473 err("%s transfer_flags %x ", __func__,urb->transfer_flags );
1474 } 1474 }
1475 1475
1476 dbg("%s - port %d", __FUNCTION__, port->number); 1476 dbg("%s - port %d", __func__, port->number);
1477 1477
1478 if (port->open_count <= 0) 1478 if (port->open_count <= 0)
1479 return; 1479 return;
1480 1480
1481 tty = port->tty; 1481 tty = port->tty;
1482 if (!tty) { 1482 if (!tty) {
1483 dbg("%s - bad tty pointer - exiting",__FUNCTION__); 1483 dbg("%s - bad tty pointer - exiting",__func__);
1484 return; 1484 return;
1485 } 1485 }
1486 1486
1487 priv = usb_get_serial_port_data(port); 1487 priv = usb_get_serial_port_data(port);
1488 if (!priv) { 1488 if (!priv) {
1489 dbg("%s - bad port private data pointer - exiting", __FUNCTION__); 1489 dbg("%s - bad port private data pointer - exiting", __func__);
1490 return; 1490 return;
1491 } 1491 }
1492 1492
1493 if (urb != port->read_urb) { 1493 if (urb != port->read_urb) {
1494 err("%s - Not my urb!", __FUNCTION__); 1494 err("%s - Not my urb!", __func__);
1495 } 1495 }
1496 1496
1497 if (status) { 1497 if (status) {
@@ -1529,39 +1529,39 @@ static void ftdi_process_read (struct work_struct *work)
1529 int packet_offset; 1529 int packet_offset;
1530 unsigned long flags; 1530 unsigned long flags;
1531 1531
1532 dbg("%s - port %d", __FUNCTION__, port->number); 1532 dbg("%s - port %d", __func__, port->number);
1533 1533
1534 if (port->open_count <= 0) 1534 if (port->open_count <= 0)
1535 return; 1535 return;
1536 1536
1537 tty = port->tty; 1537 tty = port->tty;
1538 if (!tty) { 1538 if (!tty) {
1539 dbg("%s - bad tty pointer - exiting",__FUNCTION__); 1539 dbg("%s - bad tty pointer - exiting",__func__);
1540 return; 1540 return;
1541 } 1541 }
1542 1542
1543 priv = usb_get_serial_port_data(port); 1543 priv = usb_get_serial_port_data(port);
1544 if (!priv) { 1544 if (!priv) {
1545 dbg("%s - bad port private data pointer - exiting", __FUNCTION__); 1545 dbg("%s - bad port private data pointer - exiting", __func__);
1546 return; 1546 return;
1547 } 1547 }
1548 1548
1549 urb = port->read_urb; 1549 urb = port->read_urb;
1550 if (!urb) { 1550 if (!urb) {
1551 dbg("%s - bad read_urb pointer - exiting", __FUNCTION__); 1551 dbg("%s - bad read_urb pointer - exiting", __func__);
1552 return; 1552 return;
1553 } 1553 }
1554 1554
1555 data = urb->transfer_buffer; 1555 data = urb->transfer_buffer;
1556 1556
1557 if (priv->rx_processed) { 1557 if (priv->rx_processed) {
1558 dbg("%s - already processed: %d bytes, %d remain", __FUNCTION__, 1558 dbg("%s - already processed: %d bytes, %d remain", __func__,
1559 priv->rx_processed, 1559 priv->rx_processed,
1560 urb->actual_length - priv->rx_processed); 1560 urb->actual_length - priv->rx_processed);
1561 } else { 1561 } else {
1562 /* The first two bytes of every read packet are status */ 1562 /* The first two bytes of every read packet are status */
1563 if (urb->actual_length > 2) { 1563 if (urb->actual_length > 2) {
1564 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data); 1564 usb_serial_debug_data(debug, &port->dev, __func__, urb->actual_length, data);
1565 } else { 1565 } else {
1566 dbg("Status only: %03oo %03oo",data[0],data[1]); 1566 dbg("Status only: %03oo %03oo",data[0],data[1]);
1567 } 1567 }
@@ -1591,17 +1591,17 @@ static void ftdi_process_read (struct work_struct *work)
1591 1591
1592 length = min(PKTSZ, urb->actual_length-packet_offset)-2; 1592 length = min(PKTSZ, urb->actual_length-packet_offset)-2;
1593 if (length < 0) { 1593 if (length < 0) {
1594 err("%s - bad packet length: %d", __FUNCTION__, length+2); 1594 err("%s - bad packet length: %d", __func__, length+2);
1595 length = 0; 1595 length = 0;
1596 } 1596 }
1597 1597
1598 if (priv->rx_flags & THROTTLED) { 1598 if (priv->rx_flags & THROTTLED) {
1599 dbg("%s - throttled", __FUNCTION__); 1599 dbg("%s - throttled", __func__);
1600 break; 1600 break;
1601 } 1601 }
1602 if (tty_buffer_request_room(tty, length) < length) { 1602 if (tty_buffer_request_room(tty, length) < length) {
1603 /* break out & wait for throttling/unthrottling to happen */ 1603 /* break out & wait for throttling/unthrottling to happen */
1604 dbg("%s - receive room low", __FUNCTION__); 1604 dbg("%s - receive room low", __func__);
1605 break; 1605 break;
1606 } 1606 }
1607 1607
@@ -1669,7 +1669,7 @@ static void ftdi_process_read (struct work_struct *work)
1669 /* not completely processed - record progress */ 1669 /* not completely processed - record progress */
1670 priv->rx_processed = packet_offset; 1670 priv->rx_processed = packet_offset;
1671 dbg("%s - incomplete, %d bytes processed, %d remain", 1671 dbg("%s - incomplete, %d bytes processed, %d remain",
1672 __FUNCTION__, packet_offset, 1672 __func__, packet_offset,
1673 urb->actual_length - packet_offset); 1673 urb->actual_length - packet_offset);
1674 /* check if we were throttled while processing */ 1674 /* check if we were throttled while processing */
1675 spin_lock_irqsave(&priv->rx_lock, flags); 1675 spin_lock_irqsave(&priv->rx_lock, flags);
@@ -1677,7 +1677,7 @@ static void ftdi_process_read (struct work_struct *work)
1677 priv->rx_flags |= ACTUALLY_THROTTLED; 1677 priv->rx_flags |= ACTUALLY_THROTTLED;
1678 spin_unlock_irqrestore(&priv->rx_lock, flags); 1678 spin_unlock_irqrestore(&priv->rx_lock, flags);
1679 dbg("%s - deferring remainder until unthrottled", 1679 dbg("%s - deferring remainder until unthrottled",
1680 __FUNCTION__); 1680 __func__);
1681 return; 1681 return;
1682 } 1682 }
1683 spin_unlock_irqrestore(&priv->rx_lock, flags); 1683 spin_unlock_irqrestore(&priv->rx_lock, flags);
@@ -1686,7 +1686,7 @@ static void ftdi_process_read (struct work_struct *work)
1686 /* delay processing of remainder */ 1686 /* delay processing of remainder */
1687 schedule_delayed_work(&priv->rx_work, 1); 1687 schedule_delayed_work(&priv->rx_work, 1);
1688 } else { 1688 } else {
1689 dbg("%s - port is closed", __FUNCTION__); 1689 dbg("%s - port is closed", __func__);
1690 } 1690 }
1691 return; 1691 return;
1692 } 1692 }
@@ -1704,7 +1704,7 @@ static void ftdi_process_read (struct work_struct *work)
1704 1704
1705 result = usb_submit_urb(port->read_urb, GFP_ATOMIC); 1705 result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
1706 if (result) 1706 if (result)
1707 err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); 1707 err("%s - failed resubmitting read urb, error %d", __func__, result);
1708 } 1708 }
1709 1709
1710 return; 1710 return;
@@ -1733,10 +1733,10 @@ static void ftdi_break_ctl( struct usb_serial_port *port, int break_state )
1733 FTDI_SIO_SET_DATA_REQUEST_TYPE, 1733 FTDI_SIO_SET_DATA_REQUEST_TYPE,
1734 urb_value , priv->interface, 1734 urb_value , priv->interface,
1735 buf, 0, WDR_TIMEOUT) < 0) { 1735 buf, 0, WDR_TIMEOUT) < 0) {
1736 err("%s FAILED to enable/disable break state (state was %d)", __FUNCTION__,break_state); 1736 err("%s FAILED to enable/disable break state (state was %d)", __func__,break_state);
1737 } 1737 }
1738 1738
1739 dbg("%s break state is %d - urb is %d", __FUNCTION__,break_state, urb_value); 1739 dbg("%s break state is %d - urb is %d", __func__,break_state, urb_value);
1740 1740
1741} 1741}
1742 1742
@@ -1760,18 +1760,18 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old
1760 unsigned char vstop; 1760 unsigned char vstop;
1761 unsigned char vstart; 1761 unsigned char vstart;
1762 1762
1763 dbg("%s", __FUNCTION__); 1763 dbg("%s", __func__);
1764 1764
1765 /* Force baud rate if this device requires it, unless it is set to B0. */ 1765 /* Force baud rate if this device requires it, unless it is set to B0. */
1766 if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { 1766 if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) {
1767 dbg("%s: forcing baud rate for this device", __FUNCTION__); 1767 dbg("%s: forcing baud rate for this device", __func__);
1768 tty_encode_baud_rate(port->tty, priv->force_baud, 1768 tty_encode_baud_rate(port->tty, priv->force_baud,
1769 priv->force_baud); 1769 priv->force_baud);
1770 } 1770 }
1771 1771
1772 /* Force RTS-CTS if this device requires it. */ 1772 /* Force RTS-CTS if this device requires it. */
1773 if (priv->force_rtscts) { 1773 if (priv->force_rtscts) {
1774 dbg("%s: forcing rtscts for this device", __FUNCTION__); 1774 dbg("%s: forcing rtscts for this device", __func__);
1775 termios->c_cflag |= CRTSCTS; 1775 termios->c_cflag |= CRTSCTS;
1776 } 1776 }
1777 1777
@@ -1815,7 +1815,7 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old
1815 FTDI_SIO_SET_DATA_REQUEST_TYPE, 1815 FTDI_SIO_SET_DATA_REQUEST_TYPE,
1816 urb_value , priv->interface, 1816 urb_value , priv->interface,
1817 buf, 0, WDR_SHORT_TIMEOUT) < 0) { 1817 buf, 0, WDR_SHORT_TIMEOUT) < 0) {
1818 err("%s FAILED to set databits/stopbits/parity", __FUNCTION__); 1818 err("%s FAILED to set databits/stopbits/parity", __func__);
1819 } 1819 }
1820 1820
1821 /* Now do the baudrate */ 1821 /* Now do the baudrate */
@@ -1826,14 +1826,14 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old
1826 FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 1826 FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
1827 0, priv->interface, 1827 0, priv->interface,
1828 buf, 0, WDR_TIMEOUT) < 0) { 1828 buf, 0, WDR_TIMEOUT) < 0) {
1829 err("%s error from disable flowcontrol urb", __FUNCTION__); 1829 err("%s error from disable flowcontrol urb", __func__);
1830 } 1830 }
1831 /* Drop RTS and DTR */ 1831 /* Drop RTS and DTR */
1832 clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1832 clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
1833 } else { 1833 } else {
1834 /* set the baudrate determined before */ 1834 /* set the baudrate determined before */
1835 if (change_speed(port)) { 1835 if (change_speed(port)) {
1836 err("%s urb failed to set baudrate", __FUNCTION__); 1836 err("%s urb failed to set baudrate", __func__);
1837 } 1837 }
1838 /* Ensure RTS and DTR are raised when baudrate changed from 0 */ 1838 /* Ensure RTS and DTR are raised when baudrate changed from 0 */
1839 if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) { 1839 if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) {
@@ -1844,7 +1844,7 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old
1844 /* Set flow control */ 1844 /* Set flow control */
1845 /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ 1845 /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */
1846 if (cflag & CRTSCTS) { 1846 if (cflag & CRTSCTS) {
1847 dbg("%s Setting to CRTSCTS flow control", __FUNCTION__); 1847 dbg("%s Setting to CRTSCTS flow control", __func__);
1848 if (usb_control_msg(dev, 1848 if (usb_control_msg(dev,
1849 usb_sndctrlpipe(dev, 0), 1849 usb_sndctrlpipe(dev, 0),
1850 FTDI_SIO_SET_FLOW_CTRL_REQUEST, 1850 FTDI_SIO_SET_FLOW_CTRL_REQUEST,
@@ -1862,7 +1862,7 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old
1862 * if IXOFF is not set, the pre-xon/xoff code is executed. 1862 * if IXOFF is not set, the pre-xon/xoff code is executed.
1863 */ 1863 */
1864 if (iflag & IXOFF) { 1864 if (iflag & IXOFF) {
1865 dbg("%s request to enable xonxoff iflag=%04x",__FUNCTION__,iflag); 1865 dbg("%s request to enable xonxoff iflag=%04x",__func__,iflag);
1866 // Try to enable the XON/XOFF on the ftdi_sio 1866 // Try to enable the XON/XOFF on the ftdi_sio
1867 // Set the vstart and vstop -- could have been done up above where 1867 // Set the vstart and vstop -- could have been done up above where
1868 // a lot of other dereferencing is done but that would be very 1868 // a lot of other dereferencing is done but that would be very
@@ -1883,7 +1883,7 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct ktermios *old
1883 } else { 1883 } else {
1884 /* else clause to only run if cfag ! CRTSCTS and iflag ! XOFF */ 1884 /* else clause to only run if cfag ! CRTSCTS and iflag ! XOFF */
1885 /* CHECKME Assuming XON/XOFF handled by tty stack - not by device */ 1885 /* CHECKME Assuming XON/XOFF handled by tty stack - not by device */
1886 dbg("%s Turning off hardware flow control", __FUNCTION__); 1886 dbg("%s Turning off hardware flow control", __func__);
1887 if (usb_control_msg(dev, 1887 if (usb_control_msg(dev,
1888 usb_sndctrlpipe(dev, 0), 1888 usb_sndctrlpipe(dev, 0),
1889 FTDI_SIO_SET_FLOW_CTRL_REQUEST, 1889 FTDI_SIO_SET_FLOW_CTRL_REQUEST,
@@ -1905,7 +1905,7 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
1905 unsigned char buf[2]; 1905 unsigned char buf[2];
1906 int ret; 1906 int ret;
1907 1907
1908 dbg("%s TIOCMGET", __FUNCTION__); 1908 dbg("%s TIOCMGET", __func__);
1909 switch (priv->chip_type) { 1909 switch (priv->chip_type) {
1910 case SIO: 1910 case SIO:
1911 /* Request the status from the device */ 1911 /* Request the status from the device */
@@ -1915,7 +1915,7 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
1915 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 1915 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
1916 0, 0, 1916 0, 0,
1917 buf, 1, WDR_TIMEOUT)) < 0 ) { 1917 buf, 1, WDR_TIMEOUT)) < 0 ) {
1918 err("%s Could not get modem status of device - err: %d", __FUNCTION__, 1918 err("%s Could not get modem status of device - err: %d", __func__,
1919 ret); 1919 ret);
1920 return(ret); 1920 return(ret);
1921 } 1921 }
@@ -1932,7 +1932,7 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
1932 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 1932 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
1933 0, priv->interface, 1933 0, priv->interface,
1934 buf, 2, WDR_TIMEOUT)) < 0 ) { 1934 buf, 2, WDR_TIMEOUT)) < 0 ) {
1935 err("%s Could not get modem status of device - err: %d", __FUNCTION__, 1935 err("%s Could not get modem status of device - err: %d", __func__,
1936 ret); 1936 ret);
1937 return(ret); 1937 return(ret);
1938 } 1938 }
@@ -1951,7 +1951,7 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
1951 1951
1952static int ftdi_tiocmset(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear) 1952static int ftdi_tiocmset(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear)
1953{ 1953{
1954 dbg("%s TIOCMSET", __FUNCTION__); 1954 dbg("%s TIOCMSET", __func__);
1955 return update_mctrl(port, set, clear); 1955 return update_mctrl(port, set, clear);
1956} 1956}
1957 1957
@@ -1960,7 +1960,7 @@ static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigne
1960{ 1960{
1961 struct ftdi_private *priv = usb_get_serial_port_data(port); 1961 struct ftdi_private *priv = usb_get_serial_port_data(port);
1962 1962
1963 dbg("%s cmd 0x%04x", __FUNCTION__, cmd); 1963 dbg("%s cmd 0x%04x", __func__, cmd);
1964 1964
1965 /* Based on code from acm.c and others */ 1965 /* Based on code from acm.c and others */
1966 switch (cmd) { 1966 switch (cmd) {
@@ -2019,7 +2019,7 @@ static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigne
2019 /* This is not necessarily an error - turns out the higher layers will do 2019 /* This is not necessarily an error - turns out the higher layers will do
2020 * some ioctls itself (see comment above) 2020 * some ioctls itself (see comment above)
2021 */ 2021 */
2022 dbg("%s arg not supported - it was 0x%04x - check /usr/include/asm/ioctls.h", __FUNCTION__, cmd); 2022 dbg("%s arg not supported - it was 0x%04x - check /usr/include/asm/ioctls.h", __func__, cmd);
2023 2023
2024 return(-ENOIOCTLCMD); 2024 return(-ENOIOCTLCMD);
2025} /* ftdi_ioctl */ 2025} /* ftdi_ioctl */
@@ -2030,7 +2030,7 @@ static void ftdi_throttle (struct usb_serial_port *port)
2030 struct ftdi_private *priv = usb_get_serial_port_data(port); 2030 struct ftdi_private *priv = usb_get_serial_port_data(port);
2031 unsigned long flags; 2031 unsigned long flags;
2032 2032
2033 dbg("%s - port %d", __FUNCTION__, port->number); 2033 dbg("%s - port %d", __func__, port->number);
2034 2034
2035 spin_lock_irqsave(&priv->rx_lock, flags); 2035 spin_lock_irqsave(&priv->rx_lock, flags);
2036 priv->rx_flags |= THROTTLED; 2036 priv->rx_flags |= THROTTLED;
@@ -2044,7 +2044,7 @@ static void ftdi_unthrottle (struct usb_serial_port *port)
2044 int actually_throttled; 2044 int actually_throttled;
2045 unsigned long flags; 2045 unsigned long flags;
2046 2046
2047 dbg("%s - port %d", __FUNCTION__, port->number); 2047 dbg("%s - port %d", __func__, port->number);
2048 2048
2049 spin_lock_irqsave(&priv->rx_lock, flags); 2049 spin_lock_irqsave(&priv->rx_lock, flags);
2050 actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED; 2050 actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED;
@@ -2059,7 +2059,7 @@ static int __init ftdi_init (void)
2059{ 2059{
2060 int retval; 2060 int retval;
2061 2061
2062 dbg("%s", __FUNCTION__); 2062 dbg("%s", __func__);
2063 if (vendor > 0 && product > 0) { 2063 if (vendor > 0 && product > 0) {
2064 /* Add user specified VID/PID to reserved element of table. */ 2064 /* Add user specified VID/PID to reserved element of table. */
2065 int i; 2065 int i;
@@ -2088,7 +2088,7 @@ failed_sio_register:
2088static void __exit ftdi_exit (void) 2088static void __exit ftdi_exit (void)
2089{ 2089{
2090 2090
2091 dbg("%s", __FUNCTION__); 2091 dbg("%s", __func__);
2092 2092
2093 usb_deregister (&ftdi_driver); 2093 usb_deregister (&ftdi_driver);
2094 usb_serial_deregister (&ftdi_sio_device); 2094 usb_serial_deregister (&ftdi_sio_device);