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>
This commit is contained in:
parent
d9ba9c9125
commit
ae67d7d814
|
@ -164,9 +164,15 @@ static void gigaset_modem_fill(unsigned long data)
|
||||||
{
|
{
|
||||||
struct cardstate *cs = (struct cardstate *) data;
|
struct cardstate *cs = (struct cardstate *) data;
|
||||||
struct bc_state *bcs;
|
struct bc_state *bcs;
|
||||||
|
struct sk_buff *nextskb;
|
||||||
int sent = 0;
|
int sent = 0;
|
||||||
|
|
||||||
if (!cs || !(bcs = cs->bcs)) {
|
if (!cs) {
|
||||||
|
gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bcs = cs->bcs;
|
||||||
|
if (!bcs) {
|
||||||
gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__);
|
gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -179,9 +185,11 @@ static void gigaset_modem_fill(unsigned long data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* no command to send; get skb */
|
/* no command to send; get skb */
|
||||||
if (!(bcs->tx_skb = skb_dequeue(&bcs->squeue)))
|
nextskb = skb_dequeue(&bcs->squeue);
|
||||||
|
if (!nextskb)
|
||||||
/* no skb either, nothing to do */
|
/* no skb either, nothing to do */
|
||||||
return;
|
return;
|
||||||
|
bcs->tx_skb = nextskb;
|
||||||
|
|
||||||
gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)",
|
gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)",
|
||||||
(unsigned long) bcs->tx_skb);
|
(unsigned long) bcs->tx_skb);
|
||||||
|
@ -248,7 +256,8 @@ static int gigaset_write_cmd(struct cardstate *cs, const unsigned char *buf,
|
||||||
if (len <= 0)
|
if (len <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!(cb = kmalloc(sizeof(struct cmdbuf_t) + len, GFP_ATOMIC))) {
|
cb = kmalloc(sizeof(struct cmdbuf_t) + len, GFP_ATOMIC);
|
||||||
|
if (!cb) {
|
||||||
dev_err(cs->dev, "%s: out of memory!\n", __func__);
|
dev_err(cs->dev, "%s: out of memory!\n", __func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
@ -392,7 +401,6 @@ static void gigaset_device_release(struct device *dev)
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
|
|
||||||
/* adapted from platform_device_release() in drivers/base/platform.c */
|
/* adapted from platform_device_release() in drivers/base/platform.c */
|
||||||
//FIXME is this actually necessary?
|
|
||||||
kfree(dev->platform_data);
|
kfree(dev->platform_data);
|
||||||
kfree(pdev->resource);
|
kfree(pdev->resource);
|
||||||
}
|
}
|
||||||
|
@ -404,16 +412,20 @@ static void gigaset_device_release(struct device *dev)
|
||||||
static int gigaset_initcshw(struct cardstate *cs)
|
static int gigaset_initcshw(struct cardstate *cs)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
struct ser_cardstate *scs;
|
||||||
|
|
||||||
if (!(cs->hw.ser = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL))) {
|
scs = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL);
|
||||||
|
if (!scs) {
|
||||||
pr_err("out of memory\n");
|
pr_err("out of memory\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
cs->hw.ser = scs;
|
||||||
|
|
||||||
cs->hw.ser->dev.name = GIGASET_MODULENAME;
|
cs->hw.ser->dev.name = GIGASET_MODULENAME;
|
||||||
cs->hw.ser->dev.id = cs->minor_index;
|
cs->hw.ser->dev.id = cs->minor_index;
|
||||||
cs->hw.ser->dev.dev.release = gigaset_device_release;
|
cs->hw.ser->dev.dev.release = gigaset_device_release;
|
||||||
if ((rc = platform_device_register(&cs->hw.ser->dev)) != 0) {
|
rc = platform_device_register(&cs->hw.ser->dev);
|
||||||
|
if (rc != 0) {
|
||||||
pr_err("error %d registering platform device\n", rc);
|
pr_err("error %d registering platform device\n", rc);
|
||||||
kfree(cs->hw.ser);
|
kfree(cs->hw.ser);
|
||||||
cs->hw.ser = NULL;
|
cs->hw.ser = NULL;
|
||||||
|
@ -434,7 +446,8 @@ static int gigaset_initcshw(struct cardstate *cs)
|
||||||
* Called by "gigaset_start" and "gigaset_enterconfigmode" in common.c
|
* Called by "gigaset_start" and "gigaset_enterconfigmode" in common.c
|
||||||
* and by "if_lock" and "if_termios" in interface.c
|
* and by "if_lock" and "if_termios" in interface.c
|
||||||
*/
|
*/
|
||||||
static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state, unsigned new_state)
|
static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
|
||||||
|
unsigned new_state)
|
||||||
{
|
{
|
||||||
struct tty_struct *tty = cs->hw.ser->tty;
|
struct tty_struct *tty = cs->hw.ser->tty;
|
||||||
unsigned int set, clear;
|
unsigned int set, clear;
|
||||||
|
@ -520,8 +533,8 @@ gigaset_tty_open(struct tty_struct *tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate memory for our device state and intialize it */
|
/* allocate memory for our device state and intialize it */
|
||||||
if (!(cs = gigaset_initcs(driver, 1, 1, 0, cidmode,
|
cs = gigaset_initcs(driver, 1, 1, 0, cidmode, GIGASET_MODULENAME);
|
||||||
GIGASET_MODULENAME)))
|
if (!cs)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
cs->dev = &cs->hw.ser->dev.dev;
|
cs->dev = &cs->hw.ser->dev.dev;
|
||||||
|
@ -690,7 +703,8 @@ gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf,
|
||||||
|
|
||||||
if (!cs)
|
if (!cs)
|
||||||
return;
|
return;
|
||||||
if (!(inbuf = cs->inbuf)) {
|
inbuf = cs->inbuf;
|
||||||
|
if (!inbuf) {
|
||||||
dev_err(cs->dev, "%s: no inbuf\n", __func__);
|
dev_err(cs->dev, "%s: no inbuf\n", __func__);
|
||||||
cs_put(cs);
|
cs_put(cs);
|
||||||
return;
|
return;
|
||||||
|
@ -770,18 +784,21 @@ static int __init ser_gigaset_init(void)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
gig_dbg(DEBUG_INIT, "%s", __func__);
|
gig_dbg(DEBUG_INIT, "%s", __func__);
|
||||||
if ((rc = platform_driver_register(&device_driver)) != 0) {
|
rc = platform_driver_register(&device_driver);
|
||||||
|
if (rc != 0) {
|
||||||
pr_err("error %d registering platform driver\n", rc);
|
pr_err("error %d registering platform driver\n", rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate memory for our driver state and intialize it */
|
/* allocate memory for our driver state and intialize it */
|
||||||
if (!(driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
|
driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
|
||||||
GIGASET_MODULENAME, GIGASET_DEVNAME,
|
GIGASET_MODULENAME, GIGASET_DEVNAME,
|
||||||
&ops, THIS_MODULE)))
|
&ops, THIS_MODULE);
|
||||||
|
if (!driver)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if ((rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc)) != 0) {
|
rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc);
|
||||||
|
if (rc != 0) {
|
||||||
pr_err("error %d registering line discipline\n", rc);
|
pr_err("error %d registering line discipline\n", rc);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -808,7 +825,8 @@ static void __exit ser_gigaset_exit(void)
|
||||||
driver = NULL;
|
driver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rc = tty_unregister_ldisc(N_GIGASET_M101)) != 0)
|
rc = tty_unregister_ldisc(N_GIGASET_M101);
|
||||||
|
if (rc != 0)
|
||||||
pr_err("error %d unregistering line discipline\n", rc);
|
pr_err("error %d unregistering line discipline\n", rc);
|
||||||
|
|
||||||
platform_driver_unregister(&device_driver);
|
platform_driver_unregister(&device_driver);
|
||||||
|
|
Reference in New Issue