aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-12-09 01:14:38 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-12-09 01:14:38 -0500
commitbcd6acd51f3d4d1ada201e9bc5c40a31d6d80c71 (patch)
tree2f6dffd2d3e4dd67355a224de7e7a960335a92fd /drivers/ide
parent11c34c7deaeeebcee342cbc35e1bb2a6711b2431 (diff)
parent3ff6a468b45b5dfeb0e903e56f4eb27d34b2437c (diff)
Merge commit 'origin/master' into next
Conflicts: include/linux/kvm.h
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cs.c33
-rw-r--r--drivers/ide/ide-ioctls.c2
-rw-r--r--drivers/ide/ide-pci-generic.c3
3 files changed, 14 insertions, 24 deletions
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index 063b933d864a..dd6396384c25 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -60,15 +60,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
60MODULE_DESCRIPTION("PCMCIA ATA/IDE card driver"); 60MODULE_DESCRIPTION("PCMCIA ATA/IDE card driver");
61MODULE_LICENSE("Dual MPL/GPL"); 61MODULE_LICENSE("Dual MPL/GPL");
62 62
63#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
64
65#ifdef CONFIG_PCMCIA_DEBUG
66INT_MODULE_PARM(pc_debug, 0);
67#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
68#else
69#define DEBUG(n, args...)
70#endif
71
72/*====================================================================*/ 63/*====================================================================*/
73 64
74typedef struct ide_info_t { 65typedef struct ide_info_t {
@@ -98,7 +89,7 @@ static int ide_probe(struct pcmcia_device *link)
98{ 89{
99 ide_info_t *info; 90 ide_info_t *info;
100 91
101 DEBUG(0, "ide_attach()\n"); 92 dev_dbg(&link->dev, "ide_attach()\n");
102 93
103 /* Create new ide device */ 94 /* Create new ide device */
104 info = kzalloc(sizeof(*info), GFP_KERNEL); 95 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -112,7 +103,6 @@ static int ide_probe(struct pcmcia_device *link)
112 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 103 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
113 link->io.IOAddrLines = 3; 104 link->io.IOAddrLines = 3;
114 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 105 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
115 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
116 link->conf.Attributes = CONF_ENABLE_IRQ; 106 link->conf.Attributes = CONF_ENABLE_IRQ;
117 link->conf.IntType = INT_MEMORY_AND_IO; 107 link->conf.IntType = INT_MEMORY_AND_IO;
118 108
@@ -134,7 +124,7 @@ static void ide_detach(struct pcmcia_device *link)
134 ide_hwif_t *hwif = info->host->ports[0]; 124 ide_hwif_t *hwif = info->host->ports[0];
135 unsigned long data_addr, ctl_addr; 125 unsigned long data_addr, ctl_addr;
136 126
137 DEBUG(0, "ide_detach(0x%p)\n", link); 127 dev_dbg(&link->dev, "ide_detach(0x%p)\n", link);
138 128
139 data_addr = hwif->io_ports.data_addr; 129 data_addr = hwif->io_ports.data_addr;
140 ctl_addr = hwif->io_ports.ctl_addr; 130 ctl_addr = hwif->io_ports.ctl_addr;
@@ -217,9 +207,6 @@ out_release:
217 207
218======================================================================*/ 208======================================================================*/
219 209
220#define CS_CHECK(fn, ret) \
221do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
222
223struct pcmcia_config_check { 210struct pcmcia_config_check {
224 unsigned long ctl_base; 211 unsigned long ctl_base;
225 int skip_vcc; 212 int skip_vcc;
@@ -282,11 +269,11 @@ static int ide_config(struct pcmcia_device *link)
282{ 269{
283 ide_info_t *info = link->priv; 270 ide_info_t *info = link->priv;
284 struct pcmcia_config_check *stk = NULL; 271 struct pcmcia_config_check *stk = NULL;
285 int last_ret = 0, last_fn = 0, is_kme = 0; 272 int ret = 0, is_kme = 0;
286 unsigned long io_base, ctl_base; 273 unsigned long io_base, ctl_base;
287 struct ide_host *host; 274 struct ide_host *host;
288 275
289 DEBUG(0, "ide_config(0x%p)\n", link); 276 dev_dbg(&link->dev, "ide_config(0x%p)\n", link);
290 277
291 is_kme = ((link->manf_id == MANFID_KME) && 278 is_kme = ((link->manf_id == MANFID_KME) &&
292 ((link->card_id == PRODID_KME_KXLC005_A) || 279 ((link->card_id == PRODID_KME_KXLC005_A) ||
@@ -306,8 +293,12 @@ static int ide_config(struct pcmcia_device *link)
306 io_base = link->io.BasePort1; 293 io_base = link->io.BasePort1;
307 ctl_base = stk->ctl_base; 294 ctl_base = stk->ctl_base;
308 295
309 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 296 ret = pcmcia_request_irq(link, &link->irq);
310 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 297 if (ret)
298 goto failed;
299 ret = pcmcia_request_configuration(link, &link->conf);
300 if (ret)
301 goto failed;
311 302
312 /* disable drive interrupts during IDE probe */ 303 /* disable drive interrupts during IDE probe */
313 outb(0x02, ctl_base); 304 outb(0x02, ctl_base);
@@ -342,8 +333,6 @@ err_mem:
342 printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n"); 333 printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
343 goto failed; 334 goto failed;
344 335
345cs_failed:
346 cs_error(link, last_fn, last_ret);
347failed: 336failed:
348 kfree(stk); 337 kfree(stk);
349 ide_release(link); 338 ide_release(link);
@@ -363,7 +352,7 @@ static void ide_release(struct pcmcia_device *link)
363 ide_info_t *info = link->priv; 352 ide_info_t *info = link->priv;
364 struct ide_host *host = info->host; 353 struct ide_host *host = info->host;
365 354
366 DEBUG(0, "ide_release(0x%p)\n", link); 355 dev_dbg(&link->dev, "ide_release(0x%p)\n", link);
367 356
368 if (info->ndev) 357 if (info->ndev)
369 /* FIXME: if this fails we need to queue the cleanup somehow 358 /* FIXME: if this fails we need to queue the cleanup somehow
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index d3440b5010a5..6e7ae2b6cfc6 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -162,7 +162,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
162 if (tf->command == ATA_CMD_SET_FEATURES && 162 if (tf->command == ATA_CMD_SET_FEATURES &&
163 tf->feature == SETFEATURES_XFER && 163 tf->feature == SETFEATURES_XFER &&
164 tf->nsect >= XFER_SW_DMA_0) { 164 tf->nsect >= XFER_SW_DMA_0) {
165 xfer_rate = ide_find_dma_mode(drive, XFER_UDMA_6); 165 xfer_rate = ide_find_dma_mode(drive, tf->nsect);
166 if (xfer_rate != tf->nsect) { 166 if (xfer_rate != tf->nsect) {
167 err = -EINVAL; 167 err = -EINVAL;
168 goto abort; 168 goto abort;
diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c
index 39d4e01f5c9c..a743e68a8903 100644
--- a/drivers/ide/ide-pci-generic.c
+++ b/drivers/ide/ide-pci-generic.c
@@ -162,9 +162,10 @@ static const struct pci_device_id generic_pci_tbl[] = {
162#ifdef CONFIG_BLK_DEV_IDE_SATA 162#ifdef CONFIG_BLK_DEV_IDE_SATA
163 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237_SATA), 5 }, 163 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237_SATA), 5 },
164#endif 164#endif
165 { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO), 4 },
166 { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), 4 }, 165 { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), 4 },
167 { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), 4 }, 166 { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), 4 },
167 { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_3), 4 },
168 { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_5), 4 },
168 { PCI_VDEVICE(NETCELL, PCI_DEVICE_ID_REVOLUTION), 6 }, 169 { PCI_VDEVICE(NETCELL, PCI_DEVICE_ID_REVOLUTION), 6 },
169 /* 170 /*
170 * Must come last. If you add entries adjust 171 * Must come last. If you add entries adjust