aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/common.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/common.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/common.c')
-rw-r--r--drivers/isdn/gigaset/common.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 64371995c1a9..1163d316f58c 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -11,10 +11,6 @@
11 * published by the Free Software Foundation; either version 2 of 11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version. 12 * the License, or (at your option) any later version.
13 * ===================================================================== 13 * =====================================================================
14 * ToDo: ...
15 * =====================================================================
16 * Version: $Id: common.c,v 1.104.4.22 2006/02/04 18:28:16 hjlipp Exp $
17 * =====================================================================
18 */ 14 */
19 15
20#include "gigaset.h" 16#include "gigaset.h"
@@ -101,7 +97,8 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
101 } else { 97 } else {
102 numin = len < sizeof inbuf ? len : sizeof inbuf; 98 numin = len < sizeof inbuf ? len : sizeof inbuf;
103 in = inbuf; 99 in = inbuf;
104 if (copy_from_user(inbuf, (const unsigned char __user *) buf, numin)) { 100 if (copy_from_user(inbuf, (const unsigned char __user *) buf,
101 numin)) {
105 strncpy(inbuf, "<FAULT>", sizeof inbuf); 102 strncpy(inbuf, "<FAULT>", sizeof inbuf);
106 numin = sizeof "<FAULT>" - 1; 103 numin = sizeof "<FAULT>" - 1;
107 } 104 }
@@ -425,7 +422,8 @@ void gigaset_freecs(struct cardstate *cs)
425 422
426 spin_lock_irqsave(&cs->lock, flags); 423 spin_lock_irqsave(&cs->lock, flags);
427 atomic_set(&cs->running, 0); 424 atomic_set(&cs->running, 0);
428 spin_unlock_irqrestore(&cs->lock, flags); /* event handler and timer are not rescheduled below */ 425 spin_unlock_irqrestore(&cs->lock, flags); /* event handler and timer are
426 not rescheduled below */
429 427
430 tasklet_kill(&cs->event_tasklet); 428 tasklet_kill(&cs->event_tasklet);
431 del_timer_sync(&cs->timer); 429 del_timer_sync(&cs->timer);
@@ -563,7 +561,6 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
563 if (cs->ops->initbcshw(bcs)) 561 if (cs->ops->initbcshw(bcs))
564 return bcs; 562 return bcs;
565 563
566//error:
567 dbg(DEBUG_INIT, " failed"); 564 dbg(DEBUG_INIT, " failed");
568 565
569 dbg(DEBUG_INIT, " freeing bcs[%d]->skb", channel); 566 dbg(DEBUG_INIT, " freeing bcs[%d]->skb", channel);
@@ -580,7 +577,8 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
580 * parameters: 577 * parameters:
581 * drv hardware driver the device belongs to 578 * drv hardware driver the device belongs to
582 * channels number of B channels supported by device 579 * channels number of B channels supported by device
583 * onechannel !=0: B channel data and AT commands share one communication channel 580 * onechannel !=0: B channel data and AT commands share one
581 * communication channel
584 * ==0: B channels have separate communication channels 582 * ==0: B channels have separate communication channels
585 * ignoreframes number of frames to ignore after setting up B channel 583 * ignoreframes number of frames to ignore after setting up B channel
586 * cidmode !=0: start in CallID mode 584 * cidmode !=0: start in CallID mode
@@ -619,7 +617,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
619 atomic_set(&cs->ev_tail, 0); 617 atomic_set(&cs->ev_tail, 0);
620 atomic_set(&cs->ev_head, 0); 618 atomic_set(&cs->ev_head, 0);
621 init_MUTEX_LOCKED(&cs->sem); 619 init_MUTEX_LOCKED(&cs->sem);
622 tasklet_init(&cs->event_tasklet, &gigaset_handle_event, (unsigned long) cs); 620 tasklet_init(&cs->event_tasklet, &gigaset_handle_event,
621 (unsigned long) cs);
623 atomic_set(&cs->commands_pending, 0); 622 atomic_set(&cs->commands_pending, 0);
624 cs->cur_at_seq = 0; 623 cs->cur_at_seq = 0;
625 cs->gotfwver = -1; 624 cs->gotfwver = -1;
@@ -669,14 +668,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
669 cs->curlen = 0; 668 cs->curlen = 0;
670 cs->cmdbytes = 0; 669 cs->cmdbytes = 0;
671 670
672 /*
673 * Tell the ISDN4Linux subsystem (the LL) that
674 * a driver for a USB-Device is available !
675 * If this is done, "isdnctrl" is able to bind a device for this driver even
676 * if no physical usb-device is currently connected.
677 * But this device will just be accessable if a physical USB device is connected
678 * (via "gigaset_probe") .
679 */
680 dbg(DEBUG_INIT, "setting up iif"); 671 dbg(DEBUG_INIT, "setting up iif");
681 if (!gigaset_register_to_LL(cs, modulename)) { 672 if (!gigaset_register_to_LL(cs, modulename)) {
682 err("register_isdn=>error"); 673 err("register_isdn=>error");
@@ -713,7 +704,8 @@ error: if (cs)
713} 704}
714EXPORT_SYMBOL_GPL(gigaset_initcs); 705EXPORT_SYMBOL_GPL(gigaset_initcs);
715 706
716/* ReInitialize the b-channel structure */ /* e.g. called on hangup, disconnect */ 707/* ReInitialize the b-channel structure */
708/* e.g. called on hangup, disconnect */
717void gigaset_bcs_reinit(struct bc_state *bcs) 709void gigaset_bcs_reinit(struct bc_state *bcs)
718{ 710{
719 struct sk_buff *skb; 711 struct sk_buff *skb;
@@ -723,7 +715,7 @@ void gigaset_bcs_reinit(struct bc_state *bcs)
723 while ((skb = skb_dequeue(&bcs->squeue)) != NULL) 715 while ((skb = skb_dequeue(&bcs->squeue)) != NULL)
724 dev_kfree_skb(skb); 716 dev_kfree_skb(skb);
725 717
726 spin_lock_irqsave(&cs->lock, flags); //FIXME 718 spin_lock_irqsave(&cs->lock, flags);
727 clear_at_state(&bcs->at_state); 719 clear_at_state(&bcs->at_state);
728 bcs->at_state.ConState = 0; 720 bcs->at_state.ConState = 0;
729 bcs->at_state.timer_active = 0; 721 bcs->at_state.timer_active = 0;
@@ -805,7 +797,6 @@ int gigaset_start(struct cardstate *cs)
805{ 797{
806 if (down_interruptible(&cs->sem)) 798 if (down_interruptible(&cs->sem))
807 return 0; 799 return 0;
808 //info("USB device for Gigaset 307x now attached to Dev %d", ucs->minor);
809 800
810 atomic_set(&cs->connected, 1); 801 atomic_set(&cs->connected, 1);
811 802
@@ -954,7 +945,8 @@ void gigaset_debugdrivers(void)
954 dbg(DEBUG_DRIVER, " flags 0x%02x", drv->flags[i]); 945 dbg(DEBUG_DRIVER, " flags 0x%02x", drv->flags[i]);
955 cs = drv->cs + i; 946 cs = drv->cs + i;
956 dbg(DEBUG_DRIVER, " cardstate %p", cs); 947 dbg(DEBUG_DRIVER, " cardstate %p", cs);
957 dbg(DEBUG_DRIVER, " minor_index %u", cs->minor_index); 948 dbg(DEBUG_DRIVER, " minor_index %u",
949 cs->minor_index);
958 dbg(DEBUG_DRIVER, " driver %p", cs->driver); 950 dbg(DEBUG_DRIVER, " driver %p", cs->driver);
959 dbg(DEBUG_DRIVER, " i4l id %d", cs->myid); 951 dbg(DEBUG_DRIVER, " i4l id %d", cs->myid);
960 } 952 }
@@ -1016,7 +1008,7 @@ EXPORT_SYMBOL_GPL(gigaset_freedriver);
1016 * parameters: 1008 * parameters:
1017 * minor First minor number 1009 * minor First minor number
1018 * minors Number of minors this driver can handle 1010 * minors Number of minors this driver can handle
1019 * procname Name of the driver (e.g. for /proc/tty/drivers, path in /proc/driver) 1011 * procname Name of the driver
1020 * devname Name of the device files (prefix without minor number) 1012 * devname Name of the device files (prefix without minor number)
1021 * devfsname Devfs name of the device files without %d 1013 * devfsname Devfs name of the device files without %d
1022 * return value: 1014 * return value: