diff options
author | Tilman Schmidt <tilman@imap.cc> | 2009-10-25 05:30:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-29 04:37:13 -0400 |
commit | ae67d7d81436c7e85104d586562b1a220d3cd94b (patch) | |
tree | 850463884baf3dbdf9a7cafb9113d144b46a2b53 | |
parent | d9ba9c9125d89e246dc0a0702446528acceb6ddb (diff) |
ser_gigaset: checkpatch cleanup
Duly uglified as demanded by checkpatch.pl.
Impact: cosmetic
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/isdn/gigaset/ser-gigaset.c | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index 3071a52467ed..ac3409ea5d99 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c | |||
@@ -164,9 +164,15 @@ static void gigaset_modem_fill(unsigned long data) | |||
164 | { | 164 | { |
165 | struct cardstate *cs = (struct cardstate *) data; | 165 | struct cardstate *cs = (struct cardstate *) data; |
166 | struct bc_state *bcs; | 166 | struct bc_state *bcs; |
167 | struct sk_buff *nextskb; | ||
167 | int sent = 0; | 168 | int sent = 0; |
168 | 169 | ||
169 | if (!cs || !(bcs = cs->bcs)) { | 170 | if (!cs) { |
171 | gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__); | ||
172 | return; | ||
173 | } | ||
174 | bcs = cs->bcs; | ||
175 | if (!bcs) { | ||
170 | gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__); | 176 | gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__); |
171 | return; | 177 | return; |
172 | } | 178 | } |
@@ -179,9 +185,11 @@ static void gigaset_modem_fill(unsigned long data) | |||
179 | return; | 185 | return; |
180 | 186 | ||
181 | /* no command to send; get skb */ | 187 | /* no command to send; get skb */ |
182 | if (!(bcs->tx_skb = skb_dequeue(&bcs->squeue))) | 188 | nextskb = skb_dequeue(&bcs->squeue); |
189 | if (!nextskb) | ||
183 | /* no skb either, nothing to do */ | 190 | /* no skb either, nothing to do */ |
184 | return; | 191 | return; |
192 | bcs->tx_skb = nextskb; | ||
185 | 193 | ||
186 | gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)", | 194 | gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)", |
187 | (unsigned long) bcs->tx_skb); | 195 | (unsigned long) bcs->tx_skb); |
@@ -236,19 +244,20 @@ static void flush_send_queue(struct cardstate *cs) | |||
236 | * number of bytes queued, or error code < 0 | 244 | * number of bytes queued, or error code < 0 |
237 | */ | 245 | */ |
238 | static int gigaset_write_cmd(struct cardstate *cs, const unsigned char *buf, | 246 | static int gigaset_write_cmd(struct cardstate *cs, const unsigned char *buf, |
239 | int len, struct tasklet_struct *wake_tasklet) | 247 | int len, struct tasklet_struct *wake_tasklet) |
240 | { | 248 | { |
241 | struct cmdbuf_t *cb; | 249 | struct cmdbuf_t *cb; |
242 | unsigned long flags; | 250 | unsigned long flags; |
243 | 251 | ||
244 | gigaset_dbg_buffer(cs->mstate != MS_LOCKED ? | 252 | gigaset_dbg_buffer(cs->mstate != MS_LOCKED ? |
245 | DEBUG_TRANSCMD : DEBUG_LOCKCMD, | 253 | DEBUG_TRANSCMD : DEBUG_LOCKCMD, |
246 | "CMD Transmit", len, buf); | 254 | "CMD Transmit", len, buf); |
247 | 255 | ||
248 | if (len <= 0) | 256 | if (len <= 0) |
249 | return 0; | 257 | return 0; |
250 | 258 | ||
251 | if (!(cb = kmalloc(sizeof(struct cmdbuf_t) + len, GFP_ATOMIC))) { | 259 | cb = kmalloc(sizeof(struct cmdbuf_t) + len, GFP_ATOMIC); |
260 | if (!cb) { | ||
252 | dev_err(cs->dev, "%s: out of memory!\n", __func__); | 261 | dev_err(cs->dev, "%s: out of memory!\n", __func__); |
253 | return -ENOMEM; | 262 | return -ENOMEM; |
254 | } | 263 | } |
@@ -392,7 +401,6 @@ static void gigaset_device_release(struct device *dev) | |||
392 | struct platform_device *pdev = to_platform_device(dev); | 401 | struct platform_device *pdev = to_platform_device(dev); |
393 | 402 | ||
394 | /* adapted from platform_device_release() in drivers/base/platform.c */ | 403 | /* adapted from platform_device_release() in drivers/base/platform.c */ |
395 | //FIXME is this actually necessary? | ||
396 | kfree(dev->platform_data); | 404 | kfree(dev->platform_data); |
397 | kfree(pdev->resource); | 405 | kfree(pdev->resource); |
398 | } | 406 | } |
@@ -404,16 +412,20 @@ static void gigaset_device_release(struct device *dev) | |||
404 | static int gigaset_initcshw(struct cardstate *cs) | 412 | static int gigaset_initcshw(struct cardstate *cs) |
405 | { | 413 | { |
406 | int rc; | 414 | int rc; |
415 | struct ser_cardstate *scs; | ||
407 | 416 | ||
408 | if (!(cs->hw.ser = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL))) { | 417 | scs = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL); |
418 | if (!scs) { | ||
409 | pr_err("out of memory\n"); | 419 | pr_err("out of memory\n"); |
410 | return 0; | 420 | return 0; |
411 | } | 421 | } |
422 | cs->hw.ser = scs; | ||
412 | 423 | ||
413 | cs->hw.ser->dev.name = GIGASET_MODULENAME; | 424 | cs->hw.ser->dev.name = GIGASET_MODULENAME; |
414 | cs->hw.ser->dev.id = cs->minor_index; | 425 | cs->hw.ser->dev.id = cs->minor_index; |
415 | cs->hw.ser->dev.dev.release = gigaset_device_release; | 426 | cs->hw.ser->dev.dev.release = gigaset_device_release; |
416 | if ((rc = platform_device_register(&cs->hw.ser->dev)) != 0) { | 427 | rc = platform_device_register(&cs->hw.ser->dev); |
428 | if (rc != 0) { | ||
417 | pr_err("error %d registering platform device\n", rc); | 429 | pr_err("error %d registering platform device\n", rc); |
418 | kfree(cs->hw.ser); | 430 | kfree(cs->hw.ser); |
419 | cs->hw.ser = NULL; | 431 | cs->hw.ser = NULL; |
@@ -422,7 +434,7 @@ static int gigaset_initcshw(struct cardstate *cs) | |||
422 | dev_set_drvdata(&cs->hw.ser->dev.dev, cs); | 434 | dev_set_drvdata(&cs->hw.ser->dev.dev, cs); |
423 | 435 | ||
424 | tasklet_init(&cs->write_tasklet, | 436 | tasklet_init(&cs->write_tasklet, |
425 | &gigaset_modem_fill, (unsigned long) cs); | 437 | &gigaset_modem_fill, (unsigned long) cs); |
426 | return 1; | 438 | return 1; |
427 | } | 439 | } |
428 | 440 | ||
@@ -434,7 +446,8 @@ static int gigaset_initcshw(struct cardstate *cs) | |||
434 | * Called by "gigaset_start" and "gigaset_enterconfigmode" in common.c | 446 | * Called by "gigaset_start" and "gigaset_enterconfigmode" in common.c |
435 | * and by "if_lock" and "if_termios" in interface.c | 447 | * and by "if_lock" and "if_termios" in interface.c |
436 | */ | 448 | */ |
437 | static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state, unsigned new_state) | 449 | static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state, |
450 | unsigned new_state) | ||
438 | { | 451 | { |
439 | struct tty_struct *tty = cs->hw.ser->tty; | 452 | struct tty_struct *tty = cs->hw.ser->tty; |
440 | unsigned int set, clear; | 453 | unsigned int set, clear; |
@@ -520,8 +533,8 @@ gigaset_tty_open(struct tty_struct *tty) | |||
520 | } | 533 | } |
521 | 534 | ||
522 | /* allocate memory for our device state and intialize it */ | 535 | /* allocate memory for our device state and intialize it */ |
523 | if (!(cs = gigaset_initcs(driver, 1, 1, 0, cidmode, | 536 | cs = gigaset_initcs(driver, 1, 1, 0, cidmode, GIGASET_MODULENAME); |
524 | GIGASET_MODULENAME))) | 537 | if (!cs) |
525 | goto error; | 538 | goto error; |
526 | 539 | ||
527 | cs->dev = &cs->hw.ser->dev.dev; | 540 | cs->dev = &cs->hw.ser->dev.dev; |
@@ -690,7 +703,8 @@ gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf, | |||
690 | 703 | ||
691 | if (!cs) | 704 | if (!cs) |
692 | return; | 705 | return; |
693 | if (!(inbuf = cs->inbuf)) { | 706 | inbuf = cs->inbuf; |
707 | if (!inbuf) { | ||
694 | dev_err(cs->dev, "%s: no inbuf\n", __func__); | 708 | dev_err(cs->dev, "%s: no inbuf\n", __func__); |
695 | cs_put(cs); | 709 | cs_put(cs); |
696 | return; | 710 | return; |
@@ -770,18 +784,21 @@ static int __init ser_gigaset_init(void) | |||
770 | int rc; | 784 | int rc; |
771 | 785 | ||
772 | gig_dbg(DEBUG_INIT, "%s", __func__); | 786 | gig_dbg(DEBUG_INIT, "%s", __func__); |
773 | if ((rc = platform_driver_register(&device_driver)) != 0) { | 787 | rc = platform_driver_register(&device_driver); |
788 | if (rc != 0) { | ||
774 | pr_err("error %d registering platform driver\n", rc); | 789 | pr_err("error %d registering platform driver\n", rc); |
775 | return rc; | 790 | return rc; |
776 | } | 791 | } |
777 | 792 | ||
778 | /* allocate memory for our driver state and intialize it */ | 793 | /* allocate memory for our driver state and intialize it */ |
779 | if (!(driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS, | 794 | driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS, |
780 | GIGASET_MODULENAME, GIGASET_DEVNAME, | 795 | GIGASET_MODULENAME, GIGASET_DEVNAME, |
781 | &ops, THIS_MODULE))) | 796 | &ops, THIS_MODULE); |
797 | if (!driver) | ||
782 | goto error; | 798 | goto error; |
783 | 799 | ||
784 | if ((rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc)) != 0) { | 800 | rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc); |
801 | if (rc != 0) { | ||
785 | pr_err("error %d registering line discipline\n", rc); | 802 | pr_err("error %d registering line discipline\n", rc); |
786 | goto error; | 803 | goto error; |
787 | } | 804 | } |
@@ -808,7 +825,8 @@ static void __exit ser_gigaset_exit(void) | |||
808 | driver = NULL; | 825 | driver = NULL; |
809 | } | 826 | } |
810 | 827 | ||
811 | if ((rc = tty_unregister_ldisc(N_GIGASET_M101)) != 0) | 828 | rc = tty_unregister_ldisc(N_GIGASET_M101); |
829 | if (rc != 0) | ||
812 | pr_err("error %d unregistering line discipline\n", rc); | 830 | pr_err("error %d unregistering line discipline\n", rc); |
813 | 831 | ||
814 | platform_driver_unregister(&device_driver); | 832 | platform_driver_unregister(&device_driver); |