patch-2.4.21 linux-2.4.21/drivers/ide/ide-pnp.c
Next file: linux-2.4.21/drivers/ide/ide-probe.c
Previous file: linux-2.4.21/drivers/ide/ide-pmac.c
Back to the patch index
Back to the overall index
- Lines: 113
- Date:
2003-06-13 07:51:33.000000000 -0700
- Orig file:
linux-2.4.20/drivers/ide/ide-pnp.c
- Orig date:
2001-05-01 16:06:23.000000000 -0700
diff -urN linux-2.4.20/drivers/ide/ide-pnp.c linux-2.4.21/drivers/ide/ide-pnp.c
@@ -21,12 +21,6 @@
#include <linux/isapnp.h>
-#ifndef PREPARE_FUNC
-#define PREPARE_FUNC(dev) (dev->prepare)
-#define ACTIVATE_FUNC(dev) (dev->activate)
-#define DEACTIVATE_FUNC(dev) (dev->deactivate)
-#endif
-
#define DEV_IO(dev, index) (dev->resource[index].start)
#define DEV_IRQ(dev, index) (dev->irq_resource[index].start)
@@ -54,6 +48,7 @@
};
/* Generic initialisation function for ISA PnP IDE interface */
+
static int __init pnpide_generic_init(struct pci_dev *dev, int enable)
{
hw_regs_t hw;
@@ -66,13 +61,16 @@
return 1;
ide_setup_ports(&hw, (ide_ioreg_t) DEV_IO(dev, 0),
- generic_ide_offsets, (ide_ioreg_t) DEV_IO(dev, 1),
- 0, NULL, DEV_IRQ(dev, 0));
+ generic_ide_offsets,
+ (ide_ioreg_t) DEV_IO(dev, 1),
+ 0, NULL,
+// generic_pnp_ide_iops,
+ DEV_IRQ(dev, 0));
index = ide_register_hw(&hw, NULL);
if (index != -1) {
- printk("ide%d: %s IDE interface\n", index, DEV_NAME(dev));
+ printk(KERN_INFO "ide%d: %s IDE interface\n", index, DEV_NAME(dev));
return 0;
}
@@ -88,7 +86,6 @@
{ 0 }
};
-#ifdef MODULE
#define NR_PNP_DEVICES 8
struct pnp_dev_inst {
struct pci_dev *dev;
@@ -96,11 +93,11 @@
};
static struct pnp_dev_inst devices[NR_PNP_DEVICES];
static int pnp_ide_dev_idx = 0;
-#endif
/*
* Probe for ISA PnP IDE interfaces.
*/
+
void __init pnpide_init(int enable)
{
struct pci_dev *dev = NULL;
@@ -109,19 +106,18 @@
if (!isapnp_present())
return;
-#ifdef MODULE
/* Module unload, deactivate all registered devices. */
if (!enable) {
int i;
for (i = 0; i < pnp_ide_dev_idx; i++) {
+ dev = devices[i].dev;
devices[i].dev_type->init_fn(dev, 0);
-
- if (DEACTIVATE_FUNC(devices[i].dev))
- DEACTIVATE_FUNC(devices[i].dev)(devices[i].dev);
+ if (dev->deactivate)
+ dev->deactivate(dev);
}
return;
}
-#endif
+
for (dev_type = idepnp_devices; dev_type->vendor; dev_type++) {
while ((dev = isapnp_find_dev(NULL, dev_type->vendor,
dev_type->device, dev))) {
@@ -129,20 +125,20 @@
if (dev->active)
continue;
- if (PREPARE_FUNC(dev) && (PREPARE_FUNC(dev))(dev) < 0) {
- printk("ide: %s prepare failed\n", DEV_NAME(dev));
+ if (dev->prepare && dev->prepare(dev) < 0) {
+ printk(KERN_ERR"ide-pnp: %s prepare failed\n", DEV_NAME(dev));
continue;
}
- if (ACTIVATE_FUNC(dev) && (ACTIVATE_FUNC(dev))(dev) < 0) {
- printk("ide: %s activate failed\n", DEV_NAME(dev));
+ if (dev->activate && dev->activate(dev) < 0) {
+ printk(KERN_ERR"ide: %s activate failed\n", DEV_NAME(dev));
continue;
}
/* Call device initialization function */
if (dev_type->init_fn(dev, 1)) {
- if (DEACTIVATE_FUNC(dev))
- DEACTIVATE_FUNC(dev)(dev);
+ if (dev->deactivate(dev))
+ dev->deactivate(dev);
} else {
#ifdef MODULE
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)