]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ibmtr_cs/ibmtr - get working again
authorMike Phillips <phillim2@comcast.net>
Tue, 28 Oct 2003 23:09:57 +0000 (15:09 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 28 Oct 2003 23:09:57 +0000 (15:09 -0800)
Patch to get ibmtr_cs / ibmtr working again.  A change went in a while back
I missed that killed it.  Also fixed the timer to eliminate the
uninitialized timer error on close.

drivers/net/pcmcia/ibmtr_cs.c
drivers/net/tokenring/ibmtr.c

index 03e20f5c1a9061aab145d4362a663a3c83fb049d..14c622556791236f99c75b4557219a81e2f7948a 100644 (file)
@@ -136,7 +136,7 @@ typedef struct ibmtr_dev_t {
     struct net_device  *dev;
     dev_node_t          node;
     window_handle_t     sram_win_handle;
-    struct tok_info    ti;
+    struct tok_info    *ti;
 } ibmtr_dev_t;
 
 static void netdev_get_drvinfo(struct net_device *dev,
@@ -168,13 +168,18 @@ static dev_link_t *ibmtr_attach(void)
     DEBUG(0, "ibmtr_attach()\n");
 
     /* Create new token-ring device */
-    dev = alloc_trdev(sizeof(*info));
-    if (!dev)
-           return NULL;
-    info = dev->priv;
+    info = kmalloc(sizeof(*info), GFP_KERNEL); 
+    if (!info) return NULL;
+    memset(info,0,sizeof(*info));
+    dev = alloc_trdev(sizeof(struct tok_info));
+    if (!dev) { 
+       kfree(info); 
+       return NULL;
+    } 
 
     link = &info->link;
     link->priv = info;
+    info->ti = dev->priv; 
 
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     link->io.NumPorts1 = 4;
@@ -265,6 +270,7 @@ static void ibmtr_detach(dev_link_t *link)
     *linkp = link->next;
     unregister_netdev(dev);
     free_netdev(dev);
+    kfree(info); 
 } /* ibmtr_detach */
 
 /*======================================================================
index dcee7eecda249399b28aba92929231e5f418384e..832c82ff339acfbb06c37a9696ea26efa151060b 100644 (file)
@@ -152,7 +152,7 @@ static char version[] __initdata =
 
 /* this allows displaying full adapter information */
 
-char *channel_def[] __initdata = { "ISA", "MCA", "ISA P&P" };
+char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" };
 
 static char pcchannelid[] __devinitdata = {
        0x05, 0x00, 0x04, 0x09,
@@ -864,7 +864,8 @@ static int tok_open(struct net_device *dev)
        ti->sram_virt &= ~1; /* to reverse what we do in tok_close */
        /* init the spinlock */
        ti->lock = (spinlock_t) SPIN_LOCK_UNLOCKED;
-
+       init_timer(&ti->tr_timer);
+       
        i = tok_init_card(dev);
        if (i) return i;
 
@@ -1033,7 +1034,7 @@ static int tok_close(struct net_device *dev)
 
        /* Important for PCMCIA hot unplug, otherwise, we'll pull the card, */
        /* unloading the module from memory, and then if a timer pops, ouch */
-       del_timer(&ti->tr_timer);
+       del_timer_sync(&ti->tr_timer);
        outb(0, dev->base_addr + ADAPTRESET);
        ti->sram_virt |= 1;
        ti->open_status = CLOSED;