diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/serial_cs.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 1e6889f52b38..6bcde2c7b159 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
@@ -97,7 +97,7 @@ static const struct multi_id multi_id[] = { | |||
97 | #define MULTI_COUNT (sizeof(multi_id)/sizeof(struct multi_id)) | 97 | #define MULTI_COUNT (sizeof(multi_id)/sizeof(struct multi_id)) |
98 | 98 | ||
99 | struct serial_info { | 99 | struct serial_info { |
100 | dev_link_t link; | 100 | struct pcmcia_device *p_dev; |
101 | int ndev; | 101 | int ndev; |
102 | int multi; | 102 | int multi; |
103 | int slave; | 103 | int slave; |
@@ -135,16 +135,16 @@ static void serial_remove(dev_link_t *link) | |||
135 | /* | 135 | /* |
136 | * Recheck to see if the device is still configured. | 136 | * Recheck to see if the device is still configured. |
137 | */ | 137 | */ |
138 | if (info->link.state & DEV_CONFIG) { | 138 | if (info->p_dev->state & DEV_CONFIG) { |
139 | for (i = 0; i < info->ndev; i++) | 139 | for (i = 0; i < info->ndev; i++) |
140 | serial8250_unregister_port(info->line[i]); | 140 | serial8250_unregister_port(info->line[i]); |
141 | 141 | ||
142 | info->link.dev = NULL; | 142 | info->p_dev->dev_node = NULL; |
143 | 143 | ||
144 | if (!info->slave) | 144 | if (!info->slave) |
145 | pcmcia_disable_device(link->handle); | 145 | pcmcia_disable_device(link->handle); |
146 | 146 | ||
147 | info->link.state &= ~DEV_CONFIG; | 147 | info->p_dev->state &= ~DEV_CONFIG; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
@@ -192,7 +192,7 @@ static int serial_resume(struct pcmcia_device *dev) | |||
192 | static int serial_probe(struct pcmcia_device *p_dev) | 192 | static int serial_probe(struct pcmcia_device *p_dev) |
193 | { | 193 | { |
194 | struct serial_info *info; | 194 | struct serial_info *info; |
195 | dev_link_t *link; | 195 | dev_link_t *link = dev_to_instance(p_dev); |
196 | 196 | ||
197 | DEBUG(0, "serial_attach()\n"); | 197 | DEBUG(0, "serial_attach()\n"); |
198 | 198 | ||
@@ -201,7 +201,7 @@ static int serial_probe(struct pcmcia_device *p_dev) | |||
201 | if (!info) | 201 | if (!info) |
202 | return -ENOMEM; | 202 | return -ENOMEM; |
203 | memset(info, 0, sizeof (*info)); | 203 | memset(info, 0, sizeof (*info)); |
204 | link = &info->link; | 204 | info->p_dev = p_dev; |
205 | link->priv = info; | 205 | link->priv = info; |
206 | 206 | ||
207 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 207 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
@@ -215,8 +215,6 @@ static int serial_probe(struct pcmcia_device *p_dev) | |||
215 | } | 215 | } |
216 | link->conf.IntType = INT_MEMORY_AND_IO; | 216 | link->conf.IntType = INT_MEMORY_AND_IO; |
217 | 217 | ||
218 | link->handle = p_dev; | ||
219 | p_dev->instance = link; | ||
220 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 218 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
221 | serial_config(link); | 219 | serial_config(link); |
222 | 220 | ||
@@ -660,7 +658,7 @@ void serial_config(dev_link_t * link) | |||
660 | } | 658 | } |
661 | } | 659 | } |
662 | 660 | ||
663 | link->dev = &info->node[0]; | 661 | link->dev_node = &info->node[0]; |
664 | link->state &= ~DEV_CONFIG_PENDING; | 662 | link->state &= ~DEV_CONFIG_PENDING; |
665 | kfree(cfg_mem); | 663 | kfree(cfg_mem); |
666 | return; | 664 | return; |