diff options
| author | Hannes Reinecke <hare@suse.de> | 2005-11-09 16:47:18 -0500 | 
|---|---|---|
| committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2005-11-09 16:47:18 -0500 | 
| commit | 4349d5cdf28d46c22d467079e80ee9695dcec0ad (patch) | |
| tree | f16b8cb1689a82ebb48d95f9be2f66b56fb62189 | |
| parent | a5ee3634630c218e86afc5bae2acb55b9e47625d (diff) | |
[PATCH] ide: incorrect device link for ide-cs
Devices driven by ide-cs will appear under /sys/devices instead of the
appropriate PCMCIA device. To fix this I had to extend the hw_regs_t
structure with a 'struct device' field, which allows us to set the
parent link for the appropriate hwif.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@suse.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
| -rw-r--r-- | drivers/ide/ide.c | 1 | ||||
| -rw-r--r-- | drivers/ide/legacy/ide-cs.c | 7 | ||||
| -rw-r--r-- | include/linux/ide.h | 1 | 
3 files changed, 6 insertions, 3 deletions
| diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 9fe19808d815..8af179b531c3 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
| @@ -803,6 +803,7 @@ found: | |||
| 803 | hwif->irq = hw->irq; | 803 | hwif->irq = hw->irq; | 
| 804 | hwif->noprobe = 0; | 804 | hwif->noprobe = 0; | 
| 805 | hwif->chipset = hw->chipset; | 805 | hwif->chipset = hw->chipset; | 
| 806 | hwif->gendev.parent = hw->dev; | ||
| 806 | 807 | ||
| 807 | if (!initializing) { | 808 | if (!initializing) { | 
| 808 | probe_hwif_init_with_fixup(hwif, fixup); | 809 | probe_hwif_init_with_fixup(hwif, fixup); | 
| diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 1dafffa7e513..ef79805218e4 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
| @@ -182,13 +182,14 @@ static void ide_detach(dev_link_t *link) | |||
| 182 | 182 | ||
| 183 | } /* ide_detach */ | 183 | } /* ide_detach */ | 
| 184 | 184 | ||
| 185 | static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq) | 185 | static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) | 
| 186 | { | 186 | { | 
| 187 | hw_regs_t hw; | 187 | hw_regs_t hw; | 
| 188 | memset(&hw, 0, sizeof(hw)); | 188 | memset(&hw, 0, sizeof(hw)); | 
| 189 | ide_init_hwif_ports(&hw, io, ctl, NULL); | 189 | ide_init_hwif_ports(&hw, io, ctl, NULL); | 
| 190 | hw.irq = irq; | 190 | hw.irq = irq; | 
| 191 | hw.chipset = ide_pci; | 191 | hw.chipset = ide_pci; | 
| 192 | hw.dev = &handle->dev; | ||
| 192 | return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); | 193 | return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); | 
| 193 | } | 194 | } | 
| 194 | 195 | ||
| @@ -327,12 +328,12 @@ static void ide_config(dev_link_t *link) | |||
| 327 | 328 | ||
| 328 | /* retry registration in case device is still spinning up */ | 329 | /* retry registration in case device is still spinning up */ | 
| 329 | for (hd = -1, i = 0; i < 10; i++) { | 330 | for (hd = -1, i = 0; i < 10; i++) { | 
| 330 | hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ); | 331 | hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, handle); | 
| 331 | if (hd >= 0) break; | 332 | if (hd >= 0) break; | 
| 332 | if (link->io.NumPorts1 == 0x20) { | 333 | if (link->io.NumPorts1 == 0x20) { | 
| 333 | outb(0x02, ctl_base + 0x10); | 334 | outb(0x02, ctl_base + 0x10); | 
| 334 | hd = idecs_register(io_base + 0x10, ctl_base + 0x10, | 335 | hd = idecs_register(io_base + 0x10, ctl_base + 0x10, | 
| 335 | link->irq.AssignedIRQ); | 336 | link->irq.AssignedIRQ, handle); | 
| 336 | if (hd >= 0) { | 337 | if (hd >= 0) { | 
| 337 | io_base += 0x10; | 338 | io_base += 0x10; | 
| 338 | ctl_base += 0x10; | 339 | ctl_base += 0x10; | 
| diff --git a/include/linux/ide.h b/include/linux/ide.h index 3461abc1e854..e0cf4811da08 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -230,6 +230,7 @@ typedef struct hw_regs_s { | |||
| 230 | int dma; /* our dma entry */ | 230 | int dma; /* our dma entry */ | 
| 231 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | 231 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | 
| 232 | hwif_chipset_t chipset; | 232 | hwif_chipset_t chipset; | 
| 233 | struct device *dev; | ||
| 233 | } hw_regs_t; | 234 | } hw_regs_t; | 
| 234 | 235 | ||
| 235 | /* | 236 | /* | 
