Commit 9a36fda8 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Move some init code out of line

Again, just introduce do_init() and move some code into it.
It'll be needed in the next cset.
parent 8d38b204
...@@ -900,6 +900,24 @@ do_register_isdn(struct IsdnCardState *cs) ...@@ -900,6 +900,24 @@ do_register_isdn(struct IsdnCardState *cs)
"NONE", cs->iif.id, cs->myid); "NONE", cs->iif.id, cs->myid);
} }
static int
do_init(struct IsdnCardState *cs)
{
int ret;
init_tei(cs, cs->protocol);
ret = CallcNewChan(cs);
if (ret)
return -EIO;
/* ISAR needs firmware download first */
if (!test_bit(HW_ISAR, &cs->HW_Flags))
ll_run(cs, 0);
return 0;
}
static int __devinit checkcard(int cardnr, char *id, int *busy_flag) static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
{ {
int ret = 0; int ret = 0;
...@@ -1125,17 +1143,11 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag) ...@@ -1125,17 +1143,11 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
ret = 0; ret = 0;
goto outf_cs; goto outf_cs;
} }
init_tei(cs, cs->protocol); if (do_init(cs)) {
ret = CallcNewChan(cs);
if (ret) {
closecard(cardnr); closecard(cardnr);
ret = 0; ret = 0;
goto outf_cs; goto outf_cs;
} }
/* ISAR needs firmware download first */
if (!test_bit(HW_ISAR, &cs->HW_Flags))
ll_run(cs, 0);
ret = 1; ret = 1;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment