mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 22:58:29 +00:00
[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>
This commit is contained in:
parent
a5ee363463
commit
4349d5cdf2
3 changed files with 6 additions and 3 deletions
|
@ -803,6 +803,7 @@ found:
|
||||||
hwif->irq = hw->irq;
|
hwif->irq = hw->irq;
|
||||||
hwif->noprobe = 0;
|
hwif->noprobe = 0;
|
||||||
hwif->chipset = hw->chipset;
|
hwif->chipset = hw->chipset;
|
||||||
|
hwif->gendev.parent = hw->dev;
|
||||||
|
|
||||||
if (!initializing) {
|
if (!initializing) {
|
||||||
probe_hwif_init_with_fixup(hwif, fixup);
|
probe_hwif_init_with_fixup(hwif, fixup);
|
||||||
|
|
|
@ -182,13 +182,14 @@ static void ide_detach(dev_link_t *link)
|
||||||
|
|
||||||
} /* ide_detach */
|
} /* ide_detach */
|
||||||
|
|
||||||
static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
|
static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
|
||||||
{
|
{
|
||||||
hw_regs_t hw;
|
hw_regs_t hw;
|
||||||
memset(&hw, 0, sizeof(hw));
|
memset(&hw, 0, sizeof(hw));
|
||||||
ide_init_hwif_ports(&hw, io, ctl, NULL);
|
ide_init_hwif_ports(&hw, io, ctl, NULL);
|
||||||
hw.irq = irq;
|
hw.irq = irq;
|
||||||
hw.chipset = ide_pci;
|
hw.chipset = ide_pci;
|
||||||
|
hw.dev = &handle->dev;
|
||||||
return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
|
return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,12 +328,12 @@ static void ide_config(dev_link_t *link)
|
||||||
|
|
||||||
/* retry registration in case device is still spinning up */
|
/* retry registration in case device is still spinning up */
|
||||||
for (hd = -1, i = 0; i < 10; i++) {
|
for (hd = -1, i = 0; i < 10; i++) {
|
||||||
hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ);
|
hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, handle);
|
||||||
if (hd >= 0) break;
|
if (hd >= 0) break;
|
||||||
if (link->io.NumPorts1 == 0x20) {
|
if (link->io.NumPorts1 == 0x20) {
|
||||||
outb(0x02, ctl_base + 0x10);
|
outb(0x02, ctl_base + 0x10);
|
||||||
hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
|
hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
|
||||||
link->irq.AssignedIRQ);
|
link->irq.AssignedIRQ, handle);
|
||||||
if (hd >= 0) {
|
if (hd >= 0) {
|
||||||
io_base += 0x10;
|
io_base += 0x10;
|
||||||
ctl_base += 0x10;
|
ctl_base += 0x10;
|
||||||
|
|
|
@ -230,6 +230,7 @@ typedef struct hw_regs_s {
|
||||||
int dma; /* our dma entry */
|
int dma; /* our dma entry */
|
||||||
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
|
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
|
||||||
hwif_chipset_t chipset;
|
hwif_chipset_t chipset;
|
||||||
|
struct device *dev;
|
||||||
} hw_regs_t;
|
} hw_regs_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue