aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
commit1685e633b396b0f3dabbc9fa5d65dfefe6435250 (patch)
treeee83e26e2468ca1518a1b065c690159e12c8def9 /drivers/ide
parent1cfd2bda8c486ae0e7a8005354758ebb68172bca (diff)
parent127c03cdbad9bd5af5d7f33bd31a1015a90cb77f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq pcmcia: do not request windows if you don't need to pcmcia: insert PCMCIA device resources into resource tree pcmcia: export resource information to sysfs pcmcia: use struct resource for PCMCIA devices, part 2 pcmcia: remove memreq_t pcmcia: move local definitions out of include/pcmcia/cs.h pcmcia: do not use io_req_t when calling pcmcia_request_io() pcmcia: do not use io_req_t after call to pcmcia_request_io() pcmcia: use struct resource for PCMCIA devices pcmcia: clean up cs.h pcmcia: use pcmica_{read,write}_config_byte pcmcia: remove cs_types.h pcmcia: remove unused flag, simplify headers pcmcia: remove obsolete CS_EVENT_ definitions pcmcia: split up central event handler pcmcia: simplify event callback pcmcia: remove obsolete ioctl Conflicts in: - drivers/staging/comedi/drivers/* - drivers/staging/wlags49_h2/wl_cs.c due to dev_info_t and whitespace changes
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cs.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index 0b7815d2581c..2a4cb9c18f01 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -43,7 +43,6 @@
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/system.h> 44#include <asm/system.h>
45 45
46#include <pcmcia/cs_types.h>
47#include <pcmcia/cs.h> 46#include <pcmcia/cs.h>
48#include <pcmcia/cistpl.h> 47#include <pcmcia/cistpl.h>
49#include <pcmcia/ds.h> 48#include <pcmcia/ds.h>
@@ -98,9 +97,8 @@ static int ide_probe(struct pcmcia_device *link)
98 info->p_dev = link; 97 info->p_dev = link;
99 link->priv = info; 98 link->priv = info;
100 99
101 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 100 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
102 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 101 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
103 link->io.IOAddrLines = 3;
104 link->conf.Attributes = CONF_ENABLE_IRQ; 102 link->conf.Attributes = CONF_ENABLE_IRQ;
105 link->conf.IntType = INT_MEMORY_AND_IO; 103 link->conf.IntType = INT_MEMORY_AND_IO;
106 104
@@ -229,24 +227,27 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
229 227
230 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 228 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
231 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 229 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
230 pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
231
232 pdev->conf.ConfigIndex = cfg->index; 232 pdev->conf.ConfigIndex = cfg->index;
233 pdev->io.BasePort1 = io->win[0].base; 233 pdev->resource[0]->start = io->win[0].base;
234 pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 234 if (!(io->flags & CISTPL_IO_16BIT)) {
235 if (!(io->flags & CISTPL_IO_16BIT)) 235 pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
236 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 236 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
237 }
237 if (io->nwin == 2) { 238 if (io->nwin == 2) {
238 pdev->io.NumPorts1 = 8; 239 pdev->resource[0]->end = 8;
239 pdev->io.BasePort2 = io->win[1].base; 240 pdev->resource[1]->start = io->win[1].base;
240 pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1; 241 pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
241 if (pcmcia_request_io(pdev, &pdev->io) != 0) 242 if (pcmcia_request_io(pdev) != 0)
242 return -ENODEV; 243 return -ENODEV;
243 stk->ctl_base = pdev->io.BasePort2; 244 stk->ctl_base = pdev->resource[1]->start;
244 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { 245 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
245 pdev->io.NumPorts1 = io->win[0].len; 246 pdev->resource[0]->end = io->win[0].len;
246 pdev->io.NumPorts2 = 0; 247 pdev->resource[1]->end = 0;
247 if (pcmcia_request_io(pdev, &pdev->io) != 0) 248 if (pcmcia_request_io(pdev) != 0)
248 return -ENODEV; 249 return -ENODEV;
249 stk->ctl_base = pdev->io.BasePort1 + 0x0e; 250 stk->ctl_base = pdev->resource[0]->start + 0x0e;
250 } else 251 } else
251 return -ENODEV; 252 return -ENODEV;
252 /* If we've got this far, we're done */ 253 /* If we've got this far, we're done */
@@ -280,7 +281,7 @@ static int ide_config(struct pcmcia_device *link)
280 if (pcmcia_loop_config(link, pcmcia_check_one_config, stk)) 281 if (pcmcia_loop_config(link, pcmcia_check_one_config, stk))
281 goto failed; /* No suitable config found */ 282 goto failed; /* No suitable config found */
282 } 283 }
283 io_base = link->io.BasePort1; 284 io_base = link->resource[0]->start;
284 ctl_base = stk->ctl_base; 285 ctl_base = stk->ctl_base;
285 286
286 if (!link->irq) 287 if (!link->irq)
@@ -297,7 +298,7 @@ static int ide_config(struct pcmcia_device *link)
297 outb(0x81, ctl_base+1); 298 outb(0x81, ctl_base+1);
298 299
299 host = idecs_register(io_base, ctl_base, link->irq, link); 300 host = idecs_register(io_base, ctl_base, link->irq, link);
300 if (host == NULL && link->io.NumPorts1 == 0x20) { 301 if (host == NULL && resource_size(link->resource[0]) == 0x20) {
301 outb(0x02, ctl_base + 0x10); 302 outb(0x02, ctl_base + 0x10);
302 host = idecs_register(io_base + 0x10, ctl_base + 0x10, 303 host = idecs_register(io_base + 0x10, ctl_base + 0x10,
303 link->irq, link); 304 link->irq, link);