aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/bas-gigaset.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2006-04-11 01:55:00 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:49 -0400
commit917f5085ddb3498033551e711fb22f48ddeb8378 (patch)
treeff67547a8f4cbf27e4a30b795635778d8e6cc79d /drivers/isdn/gigaset/bas-gigaset.c
parent08a53cdce62d37d918530bbbf726cc01b21dc3d1 (diff)
[PATCH] isdn4linux: Siemens Gigaset drivers: code cleanup
With Hansjoerg Lipp <hjlipp@web.de> Source code formatting cleanups for the Siemens Gigaset drivers, such as line length, comments, removal of unused declarations, and typo corrections. It does not introduce any functional changes. Signed-off-by: Hansjoerg Lipp <hjlipp@web.de> Signed-off-by: Tilman Schmidt <tilman@imap.cc> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/gigaset/bas-gigaset.c')
-rw-r--r--drivers/isdn/gigaset/bas-gigaset.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index 31f0f07832bc..fb2c13ae7cfd 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -13,10 +13,6 @@
13 * published by the Free Software Foundation; either version 2 of 13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version. 14 * the License, or (at your option) any later version.
15 * ===================================================================== 15 * =====================================================================
16 * ToDo: ...
17 * =====================================================================
18 * Version: $Id: bas-gigaset.c,v 1.52.4.19 2006/02/04 18:28:16 hjlipp Exp $
19 * =====================================================================
20 */ 16 */
21 17
22#include "gigaset.h" 18#include "gigaset.h"
@@ -70,9 +66,6 @@ static struct usb_device_id gigaset_table [] = {
70 66
71MODULE_DEVICE_TABLE(usb, gigaset_table); 67MODULE_DEVICE_TABLE(usb, gigaset_table);
72 68
73/* Get a minor range for your devices from the usb maintainer */
74#define USB_SKEL_MINOR_BASE 200
75
76/*======================= local function prototypes =============================*/ 69/*======================= local function prototypes =============================*/
77 70
78/* This function is called if a new device is connected to the USB port. It 71/* This function is called if a new device is connected to the USB port. It
@@ -240,7 +233,8 @@ static inline void dump_urb(enum debuglevel level, const char *tag,
240 (unsigned long) urb->context, 233 (unsigned long) urb->context,
241 (unsigned long) urb->complete); 234 (unsigned long) urb->complete);
242 for (i = 0; i < urb->number_of_packets; i++) { 235 for (i = 0; i < urb->number_of_packets; i++) {
243 struct usb_iso_packet_descriptor *pifd = &urb->iso_frame_desc[i]; 236 struct usb_iso_packet_descriptor *pifd
237 = &urb->iso_frame_desc[i];
244 dbg(level, 238 dbg(level,
245 " {offset=%u, length=%u, actual_length=%u, " 239 " {offset=%u, length=%u, actual_length=%u, "
246 "status=%u}", 240 "status=%u}",
@@ -777,10 +771,11 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
777 urb->iso_frame_desc[i].actual_length = 0; 771 urb->iso_frame_desc[i].actual_length = 0;
778 } 772 }
779 if (likely(atomic_read(&ubc->running))) { 773 if (likely(atomic_read(&ubc->running))) {
780 urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */ 774 urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
781 urb->transfer_flags = URB_ISO_ASAP; 775 urb->transfer_flags = URB_ISO_ASAP;
782 urb->number_of_packets = BAS_NUMFRAMES; 776 urb->number_of_packets = BAS_NUMFRAMES;
783 dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit", __func__); 777 dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit",
778 __func__);
784 rc = usb_submit_urb(urb, SLAB_ATOMIC); 779 rc = usb_submit_urb(urb, SLAB_ATOMIC);
785 if (unlikely(rc != 0)) { 780 if (unlikely(rc != 0)) {
786 err("could not resubmit isochronous read URB: %s", 781 err("could not resubmit isochronous read URB: %s",
@@ -989,7 +984,7 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
989 ubc = ucx->bcs->hw.bas; 984 ubc = ucx->bcs->hw.bas;
990 IFNULLRETVAL(ubc, -EFAULT); 985 IFNULLRETVAL(ubc, -EFAULT);
991 986
992 urb->dev = ucx->bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */ 987 urb->dev = ucx->bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
993 urb->transfer_flags = URB_ISO_ASAP; 988 urb->transfer_flags = URB_ISO_ASAP;
994 urb->transfer_buffer = ubc->isooutbuf->data; 989 urb->transfer_buffer = ubc->isooutbuf->data;
995 urb->transfer_buffer_length = sizeof(ubc->isooutbuf->data); 990 urb->transfer_buffer_length = sizeof(ubc->isooutbuf->data);
@@ -1011,7 +1006,8 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
1011 //dbg(DEBUG_ISO, "%s: frame %d length=%d", __func__, nframe, ifd->length); 1006 //dbg(DEBUG_ISO, "%s: frame %d length=%d", __func__, nframe, ifd->length);
1012 1007
1013 /* retrieve block of data to send */ 1008 /* retrieve block of data to send */
1014 ifd->offset = gigaset_isowbuf_getbytes(ubc->isooutbuf, ifd->length); 1009 ifd->offset = gigaset_isowbuf_getbytes(ubc->isooutbuf,
1010 ifd->length);
1015 if (ifd->offset < 0) { 1011 if (ifd->offset < 0) {
1016 if (ifd->offset == -EBUSY) { 1012 if (ifd->offset == -EBUSY) {
1017 dbg(DEBUG_ISO, "%s: buffer busy at frame %d", 1013 dbg(DEBUG_ISO, "%s: buffer busy at frame %d",
@@ -1123,7 +1119,8 @@ static void write_iso_tasklet(unsigned long data)
1123 break; 1119 break;
1124 case -EXDEV: /* inspect individual frames */ 1120 case -EXDEV: /* inspect individual frames */
1125 /* assumptions (for lack of documentation): 1121 /* assumptions (for lack of documentation):
1126 * - actual_length bytes of the frame in error are successfully sent 1122 * - actual_length bytes of the frame in error are
1123 * successfully sent
1127 * - all following frames are not sent at all 1124 * - all following frames are not sent at all
1128 */ 1125 */
1129 dbg(DEBUG_ISO, "%s: URB partially completed", __func__); 1126 dbg(DEBUG_ISO, "%s: URB partially completed", __func__);
@@ -1260,7 +1257,8 @@ static void read_iso_tasklet(unsigned long data)
1260 switch (urb->status) { 1257 switch (urb->status) {
1261 case 0: /* normal completion */ 1258 case 0: /* normal completion */
1262 break; 1259 break;
1263 case -EXDEV: /* inspect individual frames (we do that anyway) */ 1260 case -EXDEV: /* inspect individual frames
1261 (we do that anyway) */
1264 dbg(DEBUG_ISO, "%s: URB partially completed", __func__); 1262 dbg(DEBUG_ISO, "%s: URB partially completed", __func__);
1265 break; 1263 break;
1266 case -ENOENT: 1264 case -ENOENT:
@@ -1284,8 +1282,8 @@ static void read_iso_tasklet(unsigned long data)
1284 totleft = urb->actual_length; 1282 totleft = urb->actual_length;
1285 for (frame = 0; totleft > 0 && frame < BAS_NUMFRAMES; frame++) { 1283 for (frame = 0; totleft > 0 && frame < BAS_NUMFRAMES; frame++) {
1286 if (unlikely(urb->iso_frame_desc[frame].status)) { 1284 if (unlikely(urb->iso_frame_desc[frame].status)) {
1287 warn("isochronous read: frame %d: %s", 1285 warn("isochronous read: frame %d: %s", frame,
1288 frame, get_usb_statmsg(urb->iso_frame_desc[frame].status)); 1286 get_usb_statmsg(urb->iso_frame_desc[frame].status));
1289 break; 1287 break;
1290 } 1288 }
1291 numbytes = urb->iso_frame_desc[frame].actual_length; 1289 numbytes = urb->iso_frame_desc[frame].actual_length;
@@ -1318,7 +1316,7 @@ static void read_iso_tasklet(unsigned long data)
1318 urb->iso_frame_desc[frame].status = 0; 1316 urb->iso_frame_desc[frame].status = 0;
1319 urb->iso_frame_desc[frame].actual_length = 0; 1317 urb->iso_frame_desc[frame].actual_length = 0;
1320 } 1318 }
1321 urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */ 1319 urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
1322 urb->transfer_flags = URB_ISO_ASAP; 1320 urb->transfer_flags = URB_ISO_ASAP;
1323 urb->number_of_packets = BAS_NUMFRAMES; 1321 urb->number_of_packets = BAS_NUMFRAMES;
1324 if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) { 1322 if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) {
@@ -1792,7 +1790,8 @@ static int start_cbsend(struct cardstate *cs)
1792 * cs controller state structure 1790 * cs controller state structure
1793 * buf command string to send 1791 * buf command string to send
1794 * len number of bytes to send (max. IF_WRITEBUF) 1792 * len number of bytes to send (max. IF_WRITEBUF)
1795 * wake_tasklet tasklet to run when transmission is completed (NULL if none) 1793 * wake_tasklet tasklet to run when transmission is completed
1794 * (NULL if none)
1796 * return value: 1795 * return value:
1797 * number of bytes queued on success 1796 * number of bytes queued on success
1798 * error code < 0 on error 1797 * error code < 0 on error
@@ -1849,7 +1848,8 @@ static int gigaset_write_cmd(struct cardstate *cs,
1849 1848
1850/* gigaset_write_room 1849/* gigaset_write_room
1851 * tty_driver.write_room interface routine 1850 * tty_driver.write_room interface routine
1852 * return number of characters the driver will accept to be written via gigaset_write_cmd 1851 * return number of characters the driver will accept to be written via
1852 * gigaset_write_cmd
1853 * parameter: 1853 * parameter:
1854 * controller state structure 1854 * controller state structure
1855 * return value: 1855 * return value:
@@ -2299,7 +2299,8 @@ static int __init bas_gigaset_init(void)
2299 goto error; 2299 goto error;
2300 2300
2301 /* allocate memory for our device state and intialize it */ 2301 /* allocate memory for our device state and intialize it */
2302 cardstate = gigaset_initcs(driver, 2, 0, 0, cidmode, GIGASET_MODULENAME); 2302 cardstate = gigaset_initcs(driver, 2, 0, 0, cidmode,
2303 GIGASET_MODULENAME);
2303 if (!cardstate) 2304 if (!cardstate)
2304 goto error; 2305 goto error;
2305 2306