diff options
author | Tilman Schmidt | 2012-04-25 13:02:20 +0000 |
---|---|---|
committer | David S. Miller | 2012-05-07 22:37:56 -0400 |
commit | 81fa7b82570ec4337d328e6aee45689455508821 (patch) | |
tree | 79cdb018f497a18635ea78a171cd211845e0b605 /drivers/isdn/gigaset/i4l.c | |
parent | 7643ffbd02ac46f880f64bed24a85d453b501418 (diff) |
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/i4l.c')
-rw-r--r-- | drivers/isdn/gigaset/i4l.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index 0f13eb1de657..2d75329007f1 100644 --- a/drivers/isdn/gigaset/i4l.c +++ b/drivers/isdn/gigaset/i4l.c @@ -229,7 +229,7 @@ static int command_from_LL(isdn_ctrl *cntrl) return -EINVAL; } bcs = cs->bcs + ch; - if (!gigaset_get_channel(bcs)) { + if (gigaset_get_channel(bcs) < 0) { dev_err(cs->dev, "ISDN_CMD_DIAL: channel not free\n"); return -EBUSY; } @@ -618,7 +618,7 @@ void gigaset_isdn_stop(struct cardstate *cs) * @cs: device descriptor structure. * @isdnid: device name. * - * Return value: 1 for success, 0 for failure + * Return value: 0 on success, error code < 0 on failure */ int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid) { @@ -627,14 +627,14 @@ int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid) iif = kmalloc(sizeof *iif, GFP_KERNEL); if (!iif) { pr_err("out of memory\n"); - return 0; + return -ENOMEM; } if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index) >= sizeof iif->id) { pr_err("ID too long: %s\n", isdnid); kfree(iif); - return 0; + return -EINVAL; } iif->owner = THIS_MODULE; @@ -656,13 +656,13 @@ int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid) if (!register_isdn(iif)) { pr_err("register_isdn failed\n"); kfree(iif); - return 0; + return -EINVAL; } cs->iif = iif; cs->myid = iif->channels; /* Set my device id */ cs->hw_hdr_len = HW_HDR_LEN; - return 1; + return 0; } /** |