Commit cdbe7268 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide: PCI hotplugging fixes

Extracted from the Debian kernel package
(original patch is from Herbert Xu).
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f5aa8cc6
...@@ -409,7 +409,7 @@ static int aec62xx_irq_timeout (ide_drive_t *drive) ...@@ -409,7 +409,7 @@ static int aec62xx_irq_timeout (ide_drive_t *drive)
return 0; return 0;
} }
static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name)
{ {
int bus_speed = system_bus_clock(); int bus_speed = system_bus_clock();
...@@ -435,7 +435,7 @@ static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char ...@@ -435,7 +435,7 @@ static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char
return dev->irq; return dev->irq;
} }
static void __init init_hwif_aec62xx (ide_hwif_t *hwif) static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
{ {
hwif->autodma = 0; hwif->autodma = 0;
hwif->tuneproc = &aec62xx_tune_drive; hwif->tuneproc = &aec62xx_tune_drive;
...@@ -468,7 +468,7 @@ static void __init init_hwif_aec62xx (ide_hwif_t *hwif) ...@@ -468,7 +468,7 @@ static void __init init_hwif_aec62xx (ide_hwif_t *hwif)
hwif->drives[1].autodma = hwif->autodma; hwif->drives[1].autodma = hwif->autodma;
} }
static void __init init_dma_aec62xx (ide_hwif_t *hwif, unsigned long dmabase) static void __devinit init_dma_aec62xx(ide_hwif_t *hwif, unsigned long dmabase)
{ {
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
...@@ -490,12 +490,12 @@ static void __init init_dma_aec62xx (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -490,12 +490,12 @@ static void __init init_dma_aec62xx (ide_hwif_t *hwif, unsigned long dmabase)
ide_setup_dma(hwif, dmabase, 8); ide_setup_dma(hwif, dmabase, 8);
} }
static void __init init_setup_aec62xx (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_aec6x80(struct pci_dev *dev, ide_pci_device_t *d)
{ {
unsigned long bar4reg = pci_resource_start(dev, 4); unsigned long bar4reg = pci_resource_start(dev, 4);
......
...@@ -586,7 +586,7 @@ static int cmd646_1_ide_dma_end (ide_drive_t *drive) ...@@ -586,7 +586,7 @@ static int cmd646_1_ide_dma_end (ide_drive_t *drive)
return (dma_stat & 7) != 4; return (dma_stat & 7) != 4;
} }
static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const char *name)
{ {
u32 class_rev = 0; u32 class_rev = 0;
u8 mrdmode = 0; u8 mrdmode = 0;
...@@ -674,7 +674,7 @@ static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char ...@@ -674,7 +674,7 @@ static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char
return 0; return 0;
} }
static unsigned int __init ata66_cmd64x (ide_hwif_t *hwif) static unsigned int __devinit ata66_cmd64x(ide_hwif_t *hwif)
{ {
u8 ata66 = 0, mask = (hwif->channel) ? 0x02 : 0x01; u8 ata66 = 0, mask = (hwif->channel) ? 0x02 : 0x01;
...@@ -689,7 +689,7 @@ static unsigned int __init ata66_cmd64x (ide_hwif_t *hwif) ...@@ -689,7 +689,7 @@ static unsigned int __init ata66_cmd64x (ide_hwif_t *hwif)
return (ata66 & mask) ? 1 : 0; return (ata66 & mask) ? 1 : 0;
} }
static void __init init_hwif_cmd64x (ide_hwif_t *hwif) static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
{ {
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
unsigned int class_rev; unsigned int class_rev;
......
...@@ -235,7 +235,7 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) ...@@ -235,7 +235,7 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
*/ */
#define HPT34X_PCI_INIT_REG 0x80 #define HPT34X_PCI_INIT_REG 0x80
static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const char *name)
{ {
int i = 0; int i = 0;
unsigned long hpt34xIoBase = pci_resource_start(dev, 4); unsigned long hpt34xIoBase = pci_resource_start(dev, 4);
...@@ -289,7 +289,7 @@ static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char ...@@ -289,7 +289,7 @@ static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char
return dev->irq; return dev->irq;
} }
static void __init init_hwif_hpt34x (ide_hwif_t *hwif) static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
{ {
u16 pcicmd = 0; u16 pcicmd = 0;
......
...@@ -795,7 +795,7 @@ static int hpt370_busproc(ide_drive_t * drive, int state) ...@@ -795,7 +795,7 @@ static int hpt370_busproc(ide_drive_t * drive, int state)
return 0; return 0;
} }
static int __init init_hpt37x(struct pci_dev *dev) static int __devinit init_hpt37x(struct pci_dev *dev)
{ {
int adjust, i; int adjust, i;
u16 freq; u16 freq;
...@@ -923,7 +923,7 @@ static int __init init_hpt37x(struct pci_dev *dev) ...@@ -923,7 +923,7 @@ static int __init init_hpt37x(struct pci_dev *dev)
return 0; return 0;
} }
static int __init init_hpt366 (struct pci_dev *dev) static int __devinit init_hpt366(struct pci_dev *dev)
{ {
u32 reg1 = 0; u32 reg1 = 0;
u8 drive_fast = 0; u8 drive_fast = 0;
...@@ -958,7 +958,7 @@ static int __init init_hpt366 (struct pci_dev *dev) ...@@ -958,7 +958,7 @@ static int __init init_hpt366 (struct pci_dev *dev)
return 0; return 0;
} }
static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const char *name)
{ {
int ret = 0; int ret = 0;
u8 test = 0; u8 test = 0;
...@@ -1004,7 +1004,7 @@ static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char ...@@ -1004,7 +1004,7 @@ static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char
return dev->irq; return dev->irq;
} }
static void __init init_hwif_hpt366 (ide_hwif_t *hwif) static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
{ {
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
u8 ata66 = 0, regmask = (hwif->channel) ? 0x01 : 0x02; u8 ata66 = 0, regmask = (hwif->channel) ? 0x01 : 0x02;
...@@ -1116,7 +1116,7 @@ static void __init init_hwif_hpt366 (ide_hwif_t *hwif) ...@@ -1116,7 +1116,7 @@ static void __init init_hwif_hpt366 (ide_hwif_t *hwif)
hwif->drives[1].autodma = hwif->autodma; hwif->drives[1].autodma = hwif->autodma;
} }
static void __init init_dma_hpt366 (ide_hwif_t *hwif, unsigned long dmabase) static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
{ {
u8 masterdma = 0, slavedma = 0; u8 masterdma = 0, slavedma = 0;
u8 dma_new = 0, dma_old = 0; u8 dma_new = 0, dma_old = 0;
...@@ -1151,7 +1151,7 @@ static void __init init_dma_hpt366 (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -1151,7 +1151,7 @@ static void __init init_dma_hpt366 (ide_hwif_t *hwif, unsigned long dmabase)
ide_setup_dma(hwif, dmabase, 8); ide_setup_dma(hwif, dmabase, 8);
} }
static void __init init_setup_hpt374 (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_hpt374(struct pci_dev *dev, ide_pci_device_t *d)
{ {
struct pci_dev *findev = NULL; struct pci_dev *findev = NULL;
...@@ -1176,12 +1176,12 @@ static void __init init_setup_hpt374 (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -1176,12 +1176,12 @@ static void __init init_setup_hpt374 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
static void __init init_setup_hpt37x (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_hpt37x(struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
static void __init init_setup_hpt366 (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
{ {
struct pci_dev *findev = NULL; struct pci_dev *findev = NULL;
u8 pin1 = 0, pin2 = 0; u8 pin1 = 0, pin2 = 0;
......
...@@ -404,7 +404,7 @@ static void __devinit apple_kiwi_init(struct pci_dev *pdev) ...@@ -404,7 +404,7 @@ static void __devinit apple_kiwi_init(struct pci_dev *pdev)
} }
#endif /* CONFIG_PPC_PMAC */ #endif /* CONFIG_PPC_PMAC */
static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const char *name)
{ {
if (dev->resource[PCI_ROM_RESOURCE].start) { if (dev->resource[PCI_ROM_RESOURCE].start) {
pci_write_config_dword(dev, PCI_ROM_ADDRESS, pci_write_config_dword(dev, PCI_ROM_ADDRESS,
...@@ -429,7 +429,7 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char ...@@ -429,7 +429,7 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char
return dev->irq; return dev->irq;
} }
static void __init init_hwif_pdc202new (ide_hwif_t *hwif) static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
{ {
hwif->autodma = 0; hwif->autodma = 0;
...@@ -457,12 +457,12 @@ static void __init init_hwif_pdc202new (ide_hwif_t *hwif) ...@@ -457,12 +457,12 @@ static void __init init_hwif_pdc202new (ide_hwif_t *hwif)
#endif /* PDC202_DEBUG_CABLE */ #endif /* PDC202_DEBUG_CABLE */
} }
static void __init init_setup_pdcnew (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_pdcnew(struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
static void __init init_setup_pdc20270 (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_pdc20270(struct pci_dev *dev, ide_pci_device_t *d)
{ {
struct pci_dev *findev = NULL; struct pci_dev *findev = NULL;
...@@ -488,7 +488,7 @@ static void __init init_setup_pdc20270 (struct pci_dev *dev, ide_pci_device_t *d ...@@ -488,7 +488,7 @@ static void __init init_setup_pdc20270 (struct pci_dev *dev, ide_pci_device_t *d
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
static void __init init_setup_pdc20276 (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_pdc20276(struct pci_dev *dev, ide_pci_device_t *d)
{ {
if ((dev->bus->self) && if ((dev->bus->self) &&
(dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) && (dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) &&
......
...@@ -670,7 +670,7 @@ static int pdc202xx_tristate (ide_drive_t * drive, int state) ...@@ -670,7 +670,7 @@ static int pdc202xx_tristate (ide_drive_t * drive, int state)
return 0; return 0;
} }
static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev, const char *name)
{ {
if (dev->resource[PCI_ROM_RESOURCE].start) { if (dev->resource[PCI_ROM_RESOURCE].start) {
pci_write_config_dword(dev, PCI_ROM_ADDRESS, pci_write_config_dword(dev, PCI_ROM_ADDRESS,
...@@ -715,7 +715,7 @@ static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const cha ...@@ -715,7 +715,7 @@ static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const cha
return dev->irq; return dev->irq;
} }
static void __init init_hwif_pdc202xx (ide_hwif_t *hwif) static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
{ {
hwif->autodma = 0; hwif->autodma = 0;
hwif->tuneproc = &config_chipset_for_pio; hwif->tuneproc = &config_chipset_for_pio;
...@@ -755,7 +755,7 @@ static void __init init_hwif_pdc202xx (ide_hwif_t *hwif) ...@@ -755,7 +755,7 @@ static void __init init_hwif_pdc202xx (ide_hwif_t *hwif)
#endif /* PDC202_DEBUG_CABLE */ #endif /* PDC202_DEBUG_CABLE */
} }
static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase) static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
{ {
u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0; u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0;
...@@ -807,7 +807,7 @@ static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase) ...@@ -807,7 +807,7 @@ static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase)
ide_setup_dma(hwif, dmabase, 8); ide_setup_dma(hwif, dmabase, 8);
} }
static void __init init_setup_pdc202ata4 (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_pdc202ata4(struct pci_dev *dev, ide_pci_device_t *d)
{ {
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
u8 irq = 0, irq2 = 0; u8 irq = 0, irq2 = 0;
...@@ -837,7 +837,7 @@ static void __init init_setup_pdc202ata4 (struct pci_dev *dev, ide_pci_device_t ...@@ -837,7 +837,7 @@ static void __init init_setup_pdc202ata4 (struct pci_dev *dev, ide_pci_device_t
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
static void __init init_setup_pdc20265 (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_pdc20265(struct pci_dev *dev, ide_pci_device_t *d)
{ {
if ((dev->bus->self) && if ((dev->bus->self) &&
(dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) && (dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) &&
...@@ -866,7 +866,7 @@ static void __init init_setup_pdc20265 (struct pci_dev *dev, ide_pci_device_t *d ...@@ -866,7 +866,7 @@ static void __init init_setup_pdc20265 (struct pci_dev *dev, ide_pci_device_t *d
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
static void __init init_setup_pdc202xx (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_pdc202xx(struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
......
...@@ -651,7 +651,7 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char ...@@ -651,7 +651,7 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char
* capabilities of the hardware. * capabilities of the hardware.
*/ */
static void __init init_hwif_piix (ide_hwif_t *hwif) static void __devinit init_hwif_piix(ide_hwif_t *hwif)
{ {
u8 reg54h = 0, reg55h = 0, ata66 = 0; u8 reg54h = 0, reg55h = 0, ata66 = 0;
u8 mask = hwif->channel ? 0xc0 : 0x30; u8 mask = hwif->channel ? 0xc0 : 0x30;
...@@ -721,7 +721,7 @@ static void __init init_hwif_piix (ide_hwif_t *hwif) ...@@ -721,7 +721,7 @@ static void __init init_hwif_piix (ide_hwif_t *hwif)
* a standard ide PCI setup * a standard ide PCI setup
*/ */
static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d) static void __devinit init_setup_piix(struct pci_dev *dev, ide_pci_device_t *d)
{ {
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
} }
...@@ -750,7 +750,7 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_ ...@@ -750,7 +750,7 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_
* they are found, disable use of DMA IDE * they are found, disable use of DMA IDE
*/ */
static void __init piix_check_450nx(void) static void __devinit piix_check_450nx(void)
{ {
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
u16 cfg; u16 cfg;
......
...@@ -812,7 +812,7 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) ...@@ -812,7 +812,7 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name)
* to 133MHz clocking if the system isn't already set up to do it. * to 133MHz clocking if the system isn't already set up to do it.
*/ */
static unsigned int __init init_chipset_siimage (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, const char *name)
{ {
u32 class_rev = 0; u32 class_rev = 0;
u8 tmpbyte = 0; u8 tmpbyte = 0;
...@@ -878,7 +878,7 @@ static unsigned int __init init_chipset_siimage (struct pci_dev *dev, const char ...@@ -878,7 +878,7 @@ static unsigned int __init init_chipset_siimage (struct pci_dev *dev, const char
* extended PRD tables. Unfortunately right now we don't. * extended PRD tables. Unfortunately right now we don't.
*/ */
static void __init init_mmio_iops_siimage (ide_hwif_t *hwif) static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
{ {
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
void *addr = pci_get_drvdata(dev); void *addr = pci_get_drvdata(dev);
...@@ -997,7 +997,7 @@ static int is_dev_seagate_sata(ide_drive_t *drive) ...@@ -997,7 +997,7 @@ static int is_dev_seagate_sata(ide_drive_t *drive)
* can get the iops right before using them. * can get the iops right before using them.
*/ */
static void __init init_iops_siimage (ide_hwif_t *hwif) static void __devinit init_iops_siimage(ide_hwif_t *hwif)
{ {
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
u32 class_rev = 0; u32 class_rev = 0;
...@@ -1024,7 +1024,7 @@ static void __init init_iops_siimage (ide_hwif_t *hwif) ...@@ -1024,7 +1024,7 @@ static void __init init_iops_siimage (ide_hwif_t *hwif)
* interface. * interface.
*/ */
static unsigned int __init ata66_siimage (ide_hwif_t *hwif) static unsigned int __devinit ata66_siimage(ide_hwif_t *hwif)
{ {
unsigned long addr = siimage_selreg(hwif, 0); unsigned long addr = siimage_selreg(hwif, 0);
if (pci_get_drvdata(hwif->pci_dev) == NULL) { if (pci_get_drvdata(hwif->pci_dev) == NULL) {
...@@ -1045,7 +1045,7 @@ static unsigned int __init ata66_siimage (ide_hwif_t *hwif) ...@@ -1045,7 +1045,7 @@ static unsigned int __init ata66_siimage (ide_hwif_t *hwif)
* ide DMA handlers appropriately * ide DMA handlers appropriately
*/ */
static void __init init_hwif_siimage (ide_hwif_t *hwif) static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
{ {
hwif->autodma = 0; hwif->autodma = 0;
......
...@@ -302,7 +302,7 @@ static int trm290_ide_dma_test_irq (ide_drive_t *drive) ...@@ -302,7 +302,7 @@ static int trm290_ide_dma_test_irq (ide_drive_t *drive)
/* /*
* Invoked from ide-dma.c at boot time. * Invoked from ide-dma.c at boot time.
*/ */
void __init init_hwif_trm290 (ide_hwif_t *hwif) void __devinit init_hwif_trm290(ide_hwif_t *hwif)
{ {
unsigned int cfgbase = 0; unsigned int cfgbase = 0;
unsigned long flags; unsigned long flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment