diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-02-03 07:58:57 +1100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-02-03 07:58:57 +1100 |
commit | 9135f1901ee6449dfe338adf6e40e9c2025b8150 (patch) | |
tree | 05e1ab38563a93cf0df8c05d21062b85b14f8491 /drivers/ide/legacy/ide-cs.c | |
parent | 124d3b7041f9a0ca7c43a6293e1cae4576c32fd5 (diff) | |
parent | d59823fa44f7d9babf586b3c705db314aa0f9822 (diff) | |
download | lwn-9135f1901ee6449dfe338adf6e40e9c2025b8150.tar.gz lwn-9135f1901ee6449dfe338adf6e40e9c2025b8150.zip |
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.c | 29 |
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) static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) { + ide_hwif_t *hwif; hw_regs_t hw; + int i; + u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; + memset(&hw, 0, sizeof(hw)); - ide_init_hwif_ports(&hw, io, ctl, NULL); + ide_std_init_ports(&hw, io, ctl); hw.irq = irq; hw.chipset = ide_pci; hw.dev = &handle->dev; - return ide_register_hw(&hw, &ide_undecoded_slave, NULL); + + hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]); + if (hwif == NULL) + return -1; + + i = hwif->index; + + if (hwif->present) + ide_unregister(i, 0, 0); + else if (!hwif->hold) + ide_init_port_data(hwif, i); + + ide_init_port_hw(hwif, &hw); + hwif->quirkproc = &ide_undecoded_slave; + + idx[0] = i; + + ide_device_add(idx, NULL); + + return hwif->present ? i : -1; } /*====================================================================== @@ -337,7 +360,7 @@ void ide_release(struct pcmcia_device *link) if (info->ndev) { /* FIXME: if this fails we need to queue the cleanup somehow -- need to investigate the required PCMCIA magic */ - ide_unregister(info->hd); + ide_unregister(info->hd, 0, 0); } info->ndev = 0; |