aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
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/ata
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/ata')
-rw-r--r--drivers/ata/pata_pcmcia.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 118c28e8abaf..e944aa0c5517 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -34,7 +34,6 @@
34#include <linux/ata.h> 34#include <linux/ata.h>
35#include <linux/libata.h> 35#include <linux/libata.h>
36 36
37#include <pcmcia/cs_types.h>
38#include <pcmcia/cs.h> 37#include <pcmcia/cs.h>
39#include <pcmcia/cistpl.h> 38#include <pcmcia/cistpl.h>
40#include <pcmcia/ds.h> 39#include <pcmcia/ds.h>
@@ -201,23 +200,25 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
201 200
202 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 201 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
203 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 202 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
204 pdev->io.BasePort1 = io->win[0].base; 203 pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
205 pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 204 pdev->resource[0]->start = io->win[0].base;
206 if (!(io->flags & CISTPL_IO_16BIT)) 205 if (!(io->flags & CISTPL_IO_16BIT)) {
207 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 206 pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
207 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
208 }
208 if (io->nwin == 2) { 209 if (io->nwin == 2) {
209 pdev->io.NumPorts1 = 8; 210 pdev->resource[0]->end = 8;
210 pdev->io.BasePort2 = io->win[1].base; 211 pdev->resource[1]->start = io->win[1].base;
211 pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1; 212 pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
212 if (pcmcia_request_io(pdev, &pdev->io) != 0) 213 if (pcmcia_request_io(pdev) != 0)
213 return -ENODEV; 214 return -ENODEV;
214 stk->ctl_base = pdev->io.BasePort2; 215 stk->ctl_base = pdev->resource[1]->start;
215 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { 216 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
216 pdev->io.NumPorts1 = io->win[0].len; 217 pdev->resource[0]->end = io->win[0].len;
217 pdev->io.NumPorts2 = 0; 218 pdev->resource[1]->end = 0;
218 if (pcmcia_request_io(pdev, &pdev->io) != 0) 219 if (pcmcia_request_io(pdev) != 0)
219 return -ENODEV; 220 return -ENODEV;
220 stk->ctl_base = pdev->io.BasePort1 + 0x0e; 221 stk->ctl_base = pdev->resource[0]->start + 0x0e;
221 } else 222 } else
222 return -ENODEV; 223 return -ENODEV;
223 /* If we've got this far, we're done */ 224 /* If we've got this far, we're done */
@@ -246,9 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
246 struct ata_port_operations *ops = &pcmcia_port_ops; 247 struct ata_port_operations *ops = &pcmcia_port_ops;
247 248
248 /* Set up attributes in order to probe card and get resources */ 249 /* Set up attributes in order to probe card and get resources */
249 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 250 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
250 pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 251 pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
251 pdev->io.IOAddrLines = 3;
252 pdev->conf.Attributes = CONF_ENABLE_IRQ; 252 pdev->conf.Attributes = CONF_ENABLE_IRQ;
253 pdev->conf.IntType = INT_MEMORY_AND_IO; 253 pdev->conf.IntType = INT_MEMORY_AND_IO;
254 254
@@ -271,7 +271,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
271 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) 271 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk))
272 goto failed; /* No suitable config found */ 272 goto failed; /* No suitable config found */
273 } 273 }
274 io_base = pdev->io.BasePort1; 274 io_base = pdev->resource[0]->start;
275 ctl_base = stk->ctl_base; 275 ctl_base = stk->ctl_base;
276 if (!pdev->irq) 276 if (!pdev->irq)
277 goto failed; 277 goto failed;
@@ -294,7 +294,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
294 294
295 /* FIXME: Could be more ports at base + 0x10 but we only deal with 295 /* FIXME: Could be more ports at base + 0x10 but we only deal with
296 one right now */ 296 one right now */
297 if (pdev->io.NumPorts1 >= 0x20) 297 if (resource_size(pdev->resource[0]) >= 0x20)
298 n_ports = 2; 298 n_ports = 2;
299 299
300 if (pdev->manf_id == 0x0097 && pdev->card_id == 0x1620) 300 if (pdev->manf_id == 0x0097 && pdev->card_id == 0x1620)