aboutsummaryrefslogtreecommitdiff
path: root/drivers/isdn
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2009-05-13 12:44:17 +0000
committerDavid S. Miller <davem@davemloft.net>2009-05-17 20:51:25 -0700
commit7226d7c9607b754cdad612b75122d640ff3b85ed (patch)
treeab2451fc73ed8e9a2a355cc063b4e7968dab0268 /drivers/isdn
parent1315d69634834f1f485b21b0ed8f10b763a675d2 (diff)
gigaset: fix error return code
gigaset_register_to_LL() is expected to print a message and return 0 on failure. Make it do so consistently. Impact: error handling bugfix Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/gigaset/i4l.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 69a702f0db9..9b22f9cf2f3 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -544,11 +544,11 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
gig_dbg(DEBUG_ANY, "Register driver capabilities to LL");
- //iif->id[sizeof(iif->id) - 1]=0;
- //strncpy(iif->id, isdnid, sizeof(iif->id) - 1);
if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index)
- >= sizeof iif->id)
- return -ENOMEM; //FIXME EINVAL/...??
+ >= sizeof iif->id) {
+ pr_err("ID too long: %s\n", isdnid);
+ return 0;
+ }
iif->owner = THIS_MODULE;
iif->channels = cs->channels;
@@ -568,8 +568,10 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
iif->rcvcallb_skb = NULL; /* Will be set by LL */
iif->statcallb = NULL; /* Will be set by LL */
- if (!register_isdn(iif))
+ if (!register_isdn(iif)) {
+ pr_err("register_isdn failed\n");
return 0;
+ }
cs->myid = iif->channels; /* Set my device id */
return 1;