aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/telephony
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/telephony')
-rw-r--r--drivers/telephony/ixj_pcmcia.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
index de794b21d7ff..0afd6c04f2f8 100644
--- a/drivers/telephony/ixj_pcmcia.c
+++ b/drivers/telephony/ixj_pcmcia.c
@@ -40,30 +40,20 @@ static void ixj_cs_release(dev_link_t * link);
40 40
41static int ixj_attach(struct pcmcia_device *p_dev) 41static int ixj_attach(struct pcmcia_device *p_dev)
42{ 42{
43 dev_link_t *link;
44
45 DEBUG(0, "ixj_attach()\n"); 43 DEBUG(0, "ixj_attach()\n");
46 /* Create new ixj device */ 44 /* Create new ixj device */
47 link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); 45 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
48 if (!link) 46 p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
49 return -ENOMEM; 47 p_dev->io.IOAddrLines = 3;
50 memset(link, 0, sizeof(struct dev_link_t)); 48 p_dev->conf.IntType = INT_MEMORY_AND_IO;
51 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 49 p_dev->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
52 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 50 if (!p_dev->priv) {
53 link->io.IOAddrLines = 3;
54 link->conf.IntType = INT_MEMORY_AND_IO;
55 link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
56 if (!link->priv) {
57 kfree(link);
58 return -ENOMEM; 51 return -ENOMEM;
59 } 52 }
60 memset(link->priv, 0, sizeof(struct ixj_info_t)); 53 memset(p_dev->priv, 0, sizeof(struct ixj_info_t));
61
62 link->handle = p_dev;
63 p_dev->instance = link;
64 54
65 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 55 p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
66 ixj_config(link); 56 ixj_config(p_dev);
67 57
68 return 0; 58 return 0;
69} 59}
@@ -79,7 +69,6 @@ static void ixj_detach(struct pcmcia_device *p_dev)
79 ixj_cs_release(link); 69 ixj_cs_release(link);
80 70
81 kfree(link->priv); 71 kfree(link->priv);
82 kfree(link);
83} 72}
84 73
85#define CS_CHECK(fn, ret) \ 74#define CS_CHECK(fn, ret) \
@@ -212,7 +201,7 @@ static void ixj_config(dev_link_t * link)
212 201
213 info->ndev = 1; 202 info->ndev = 1;
214 info->node.major = PHONE_MAJOR; 203 info->node.major = PHONE_MAJOR;
215 link->dev = &info->node; 204 link->dev_node = &info->node;
216 ixj_get_serial(link, j); 205 ixj_get_serial(link, j);
217 link->state &= ~DEV_CONFIG_PENDING; 206 link->state &= ~DEV_CONFIG_PENDING;
218 return; 207 return;