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)
"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)
{
int ret = 0;
......@@ -1125,17 +1143,11 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
ret = 0;
goto outf_cs;
}
init_tei(cs, cs->protocol);
ret = CallcNewChan(cs);
if (ret) {
if (do_init(cs)) {
closecard(cardnr);
ret = 0;
goto outf_cs;
}
/* ISAR needs firmware download first */
if (!test_bit(HW_ISAR, &cs->HW_Flags))
ll_run(cs, 0);
ret = 1;
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