aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2009-05-13 08:44:17 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-17 23:51:25 -0400
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 69a702f0db93..9b22f9cf2f33 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)
544 544
545 gig_dbg(DEBUG_ANY, "Register driver capabilities to LL"); 545 gig_dbg(DEBUG_ANY, "Register driver capabilities to LL");
546 546
547 //iif->id[sizeof(iif->id) - 1]=0;
548 //strncpy(iif->id, isdnid, sizeof(iif->id) - 1);
549 if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index) 547 if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index)
550 >= sizeof iif->id) 548 >= sizeof iif->id) {
551 return -ENOMEM; //FIXME EINVAL/...?? 549 pr_err("ID too long: %s\n", isdnid);
550 return 0;
551 }
552 552
553 iif->owner = THIS_MODULE; 553 iif->owner = THIS_MODULE;
554 iif->channels = cs->channels; 554 iif->channels = cs->channels;
@@ -568,8 +568,10 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
568 iif->rcvcallb_skb = NULL; /* Will be set by LL */ 568 iif->rcvcallb_skb = NULL; /* Will be set by LL */
569 iif->statcallb = NULL; /* Will be set by LL */ 569 iif->statcallb = NULL; /* Will be set by LL */
570 570
571 if (!register_isdn(iif)) 571 if (!register_isdn(iif)) {
572 pr_err("register_isdn failed\n");
572 return 0; 573 return 0;
574 }
573 575
574 cs->myid = iif->channels; /* Set my device id */ 576 cs->myid = iif->channels; /* Set my device id */
575 return 1; 577 return 1;