scc_pata: store 'hwif' pointer in struct scc_ports
Replace 'unsigned char hwif_id' by 'ide_hwif_t *hwif' in struct scc_ports. This allows us to remove ide_hwifs[] usage from scc_remove(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
84f05df49a
commit
589b062620
|
@ -65,7 +65,7 @@
|
|||
|
||||
static struct scc_ports {
|
||||
unsigned long ctl, dma;
|
||||
unsigned char hwif_id; /* for removing hwif from system */
|
||||
ide_hwif_t *hwif; /* for removing port from system */
|
||||
} scc_ports[MAX_HWIFS];
|
||||
|
||||
/* PIO transfer mode table */
|
||||
|
@ -692,7 +692,7 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
|
|||
{
|
||||
struct scc_ports *ports = ide_get_hwifdata(hwif);
|
||||
|
||||
ports->hwif_id = hwif->index;
|
||||
ports->hwif = hwif;
|
||||
|
||||
hwif->dma_command = hwif->dma_base;
|
||||
hwif->dma_status = hwif->dma_base + 0x04;
|
||||
|
@ -754,7 +754,7 @@ static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_i
|
|||
static void __devexit scc_remove(struct pci_dev *dev)
|
||||
{
|
||||
struct scc_ports *ports = pci_get_drvdata(dev);
|
||||
ide_hwif_t *hwif = &ide_hwifs[ports->hwif_id];
|
||||
ide_hwif_t *hwif = ports->hwif;
|
||||
unsigned long ctl_base = pci_resource_start(dev, 0);
|
||||
unsigned long dma_base = pci_resource_start(dev, 1);
|
||||
unsigned long ctl_size = pci_resource_len(dev, 0);
|
||||
|
|
Loading…
Reference in New Issue