aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ide-cs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-02-02 15:58:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-02 15:58:57 -0500
commit9135f1901ee6449dfe338adf6e40e9c2025b8150 (patch)
tree05e1ab38563a93cf0df8c05d21062b85b14f8491 /drivers/ide/legacy/ide-cs.c
parent124d3b7041f9a0ca7c43a6293e1cae4576c32fd5 (diff)
parentd59823fa44f7d9babf586b3c705db314aa0f9822 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (95 commits) ide-tape: remove idetape_config_t typedef ide-tape: remove mtio.h related comments ide-tape: make function name more accurate ide-tape: remove unused sense packet commands. ide-tape: use generic byteorder macros ide-tape: remove EXPERIMENTAL driver status ide-tape: use generic scsi commands ide-tape: remove struct idetape_block_size_page_t ide-tape: remove structs os_partition_t, os_dat_entry_t, os_dat_t ide-tape: remove struct idetape_parameter_block_descriptor_t ide-tape: remove struct idetape_medium_partition_page_t ide-tape: remove struct idetape_data_compression_page_t ide-tape: remove struct idetape_inquiry_result_t ide-tape: remove struct idetape_capabilities_page_t ide-tape: remove IDETAPE_DEBUG_BUGS ide-tape: remove IDETAPE_DEBUG_INFO ide-tape: dump gcw fields on error in idetape_identify_device() ide-tape: remove struct idetape_mode_parameter_header_t ide-tape: remove struct idetape_request_sense_result_t ide-tape: remove dead code ...
Diffstat (limited to 'drivers/ide/legacy/ide-cs.c')
-rw-r--r--drivers/ide/legacy/ide-cs.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 3bd29676ef6a..15ccf6944ae2 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -145,13 +145,36 @@ static void ide_detach(struct pcmcia_device *link)
145 145
146static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) 146static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
147{ 147{
148 ide_hwif_t *hwif;
148 hw_regs_t hw; 149 hw_regs_t hw;
150 int i;
151 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
152
149 memset(&hw, 0, sizeof(hw)); 153 memset(&hw, 0, sizeof(hw));
150 ide_init_hwif_ports(&hw, io, ctl, NULL); 154 ide_std_init_ports(&hw, io, ctl);
151 hw.irq = irq; 155 hw.irq = irq;
152 hw.chipset = ide_pci; 156 hw.chipset = ide_pci;
153 hw.dev = &handle->dev; 157 hw.dev = &handle->dev;
154 return ide_register_hw(&hw, &ide_undecoded_slave, NULL); 158
159 hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
160 if (hwif == NULL)
161 return -1;
162
163 i = hwif->index;
164
165 if (hwif->present)
166 ide_unregister(i, 0, 0);
167 else if (!hwif->hold)
168 ide_init_port_data(hwif, i);
169
170 ide_init_port_hw(hwif, &hw);
171 hwif->quirkproc = &ide_undecoded_slave;
172
173 idx[0] = i;
174
175 ide_device_add(idx, NULL);
176
177 return hwif->present ? i : -1;
155} 178}
156 179
157/*====================================================================== 180/*======================================================================
@@ -337,7 +360,7 @@ void ide_release(struct pcmcia_device *link)
337 if (info->ndev) { 360 if (info->ndev) {
338 /* FIXME: if this fails we need to queue the cleanup somehow 361 /* FIXME: if this fails we need to queue the cleanup somehow
339 -- need to investigate the required PCMCIA magic */ 362 -- need to investigate the required PCMCIA magic */
340 ide_unregister(info->hd); 363 ide_unregister(info->hd, 0, 0);
341 } 364 }
342 info->ndev = 0; 365 info->ndev = 0;
343 366