]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/hisax/config.c
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
[linux-2.6-omap-h63xx.git] / drivers / isdn / hisax / config.c
index 97097ef3491e6622e4188136d224d3b38297c612..ded9d0baf607b0daa8450c1b0e7bad775285e048 100644 (file)
@@ -847,7 +847,7 @@ static int init_card(struct IsdnCardState *cs)
        return 3;
 }
 
-static int hisax_cs_setup_card(struct IsdnCard *card)
+static int __devinit hisax_cs_setup_card(struct IsdnCard *card)
 {
        int ret;
 
@@ -1166,7 +1166,12 @@ outf_cs:
        return 0;
 }
 
-static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
+/* Used from an exported function but calls __devinit functions.
+ * Tell modpost not to warn (__ref)
+ */
+static int __ref checkcard(int cardnr, char *id, int *busy_flag,
+                          struct module *lockowner,
+                          hisax_setup_func_t card_setup)
 {
        int ret;
        struct IsdnCard *card = cards + cardnr;
@@ -1184,7 +1189,7 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow
               (card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
               "NONE", cs->iif.id, cs->myid);
 
-       ret = hisax_cs_setup_card(card);
+       ret = card_setup(card);
        if (!ret) {
                ll_unload(cs);
                goto outf_cs;
@@ -1208,7 +1213,7 @@ static void HiSax_shiftcards(int idx)
                memcpy(&cards[i], &cards[i + 1], sizeof(cards[i]));
 }
 
-static int HiSax_inithardware(int *busy_flag)
+static int __init HiSax_inithardware(int *busy_flag)
 {
        int foundcards = 0;
        int i = 0;
@@ -1238,7 +1243,8 @@ static int HiSax_inithardware(int *busy_flag)
                        else
                                sprintf(ids, "%s%d", id, i);
                }
-               if (checkcard(i, ids, busy_flag, THIS_MODULE)) {
+               if (checkcard(i, ids, busy_flag, THIS_MODULE,
+                             hisax_cs_setup_card)) {
                        foundcards++;
                        i++;
                } else {
@@ -1536,7 +1542,9 @@ static void __exit HiSax_exit(void)
        printk(KERN_INFO "HiSax module removed\n");
 }
 
-int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
+#ifdef CONFIG_HOTPLUG
+
+int __devinit hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
 {
        u_char ids[16];
        int ret = -1;
@@ -1546,7 +1554,8 @@ int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
                sprintf(ids, "HiSax%d", nrcards);
        else
                sprintf(ids, "HiSax");
-       if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE))
+       if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE,
+                      hisax_cs_setup_card))
                goto error;
 
        ret = nrcards;
@@ -1556,6 +1565,8 @@ error:
 }
 
 EXPORT_SYMBOL(hisax_init_pcmcia);
+#endif
+
 EXPORT_SYMBOL(HiSax_closecard);
 
 #include "hisax_if.h"
@@ -1573,6 +1584,11 @@ static void hisax_bc_close(struct BCState *bcs);
 static void hisax_bh(struct work_struct *work);
 static void EChannel_proc_rcv(struct hisax_d_if *d_if);
 
+static int hisax_setup_card_dynamic(struct IsdnCard *card)
+{
+       return 2;
+}
+
 int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
                   char *name, int protocol)
 {
@@ -1592,7 +1608,8 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
        cards[i].protocol = protocol;
        sprintf(id, "%s%d", name, i);
        nrcards++;
-       retval = checkcard(i, id, NULL, hisax_d_if->owner);
+       retval = checkcard(i, id, NULL, hisax_d_if->owner,
+                               hisax_setup_card_dynamic);
        if (retval == 0) { // yuck
                cards[i].typ = 0;
                nrcards--;