summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/usb-gigaset.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2012-04-25 13:02:20 +0000
committerDavid S. Miller <davem@davemloft.net>2012-05-07 22:37:56 -0400
commit81fa7b82570ec4337d328e6aee45689455508821 (patch)
tree79cdb018f497a18635ea78a171cd211845e0b605 /drivers/isdn/gigaset/usb-gigaset.c
parent7643ffbd02ac46f880f64bed24a85d453b501418 (diff)
downloadop-kernel-dev-81fa7b82570ec4337d328e6aee45689455508821.zip
op-kernel-dev-81fa7b82570ec4337d328e6aee45689455508821.tar.gz
isdn/gigaset: unify function return values
Various functions in the Gigaset driver were using different conventions for the meaning of their int return values. Align them to the usual negative error numbers convention. Inspired-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/usb-gigaset.c')
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index 049da67..bb12d80 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -549,10 +549,9 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
0, 0, &buf, 6, 2000);
}
-static int gigaset_freebcshw(struct bc_state *bcs)
+static void gigaset_freebcshw(struct bc_state *bcs)
{
/* unused */
- return 1;
}
/* Initialize the b-channel structure */
@@ -560,7 +559,7 @@ static int gigaset_initbcshw(struct bc_state *bcs)
{
/* unused */
bcs->hw.usb = NULL;
- return 1;
+ return 0;
}
static void gigaset_reinitbcshw(struct bc_state *bcs)
@@ -582,7 +581,7 @@ static int gigaset_initcshw(struct cardstate *cs)
kmalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
if (!ucs) {
pr_err("out of memory\n");
- return 0;
+ return -ENOMEM;
}
ucs->bchars[0] = 0;
@@ -597,7 +596,7 @@ static int gigaset_initcshw(struct cardstate *cs)
tasklet_init(&cs->write_tasklet,
gigaset_modem_fill, (unsigned long) cs);
- return 1;
+ return 0;
}
/* Send data from current skb to the device. */
@@ -766,9 +765,9 @@ static int gigaset_probe(struct usb_interface *interface,
if (startmode == SM_LOCKED)
cs->mstate = MS_LOCKED;
- if (!gigaset_start(cs)) {
+ retval = gigaset_start(cs);
+ if (retval < 0) {
tasklet_kill(&cs->write_tasklet);
- retval = -ENODEV;
goto error;
}
return 0;
@@ -898,8 +897,10 @@ static int __init usb_gigaset_init(void)
driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
GIGASET_MODULENAME, GIGASET_DEVNAME,
&ops, THIS_MODULE);
- if (driver == NULL)
+ if (driver == NULL) {
+ result = -ENOMEM;
goto error;
+ }
/* register this driver with the USB subsystem */
result = usb_register(&gigaset_usb_driver);
@@ -915,7 +916,7 @@ error:
if (driver)
gigaset_freedriver(driver);
driver = NULL;
- return -1;
+ return result;
}
/*
OpenPOWER on IntegriCloud