patch-2.1.93 linux/drivers/block/rz1000.c

Next file: linux/drivers/block/sl82c105.c
Previous file: linux/drivers/block/opti621.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.92/linux/drivers/block/rz1000.c linux/drivers/block/rz1000.c
@@ -25,7 +25,6 @@
 #include <linux/blkdev.h>
 #include <linux/hdreg.h>
 #include <asm/io.h>
-#include <linux/bios32.h>
 #include <linux/pci.h>
 #include "ide.h"
 
@@ -34,10 +33,11 @@
 __initfunc(void ide_init_rz1000 (ide_hwif_t *hwif))	/* called from ide-pci.c */
 {
 	unsigned short reg;
+	struct pci_dev *dev = hwif->pci_dev;
 
 	hwif->chipset = ide_rz1000;
-	if (!pcibios_read_config_word (hwif->pci_bus, hwif->pci_fn, 0x40, &reg)
-	 && !pcibios_write_config_word(hwif->pci_bus, hwif->pci_fn, 0x40, reg & 0xdfff))
+	if (!pci_read_config_word (dev, 0x40, &reg)
+	 && !pci_write_config_word(dev, 0x40, reg & 0xdfff))
 	{
 		printk("%s: disabled chipset read-ahead (buggy RZ1000/RZ1001)\n", hwif->name);
 	} else {
@@ -50,16 +50,16 @@
 
 #else
 
-__initfunc(static void init_rz1000 (byte bus, byte fn, const char *name))
+__initfunc(static void init_rz1000 (struct pci_dev *dev, const char *name))
 {
 	unsigned short reg, h;
 
-	if (!pcibios_read_config_word (bus, fn, PCI_COMMAND, &reg) && !(reg & 1)) {
+	if (!pci_read_config_word (dev, PCI_COMMAND, &reg) && !(reg & PCI_COMMAND_IO)) {
 		printk("%s: buggy IDE controller disabled (BIOS)\n", name);
 		return;
 	}
-	if (!pcibios_read_config_word (bus, fn, 0x40, &reg)
-	 && !pcibios_write_config_word(bus, fn, 0x40, reg & 0xdfff))
+	if (!pci_read_config_word (dev, 0x40, &reg)
+	 && !pci_write_config_word(dev, 0x40, reg & 0xdfff))
 	{
 		printk("IDE: disabled chipset read-ahead (buggy %s)\n", name);
 	} else {
@@ -82,12 +82,12 @@
 
 __initfunc(void ide_probe_for_rz100x (void))	/* called from ide.c */
 {
-	byte index, bus, fn;
+	struct pci_dev *dev = NULL;
 
-	for (index = 0; !pcibios_find_device (PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, index, &bus, &fn); ++index)
-		init_rz1000 (bus, fn, "RZ1000");
-	for (index = 0; !pcibios_find_device (PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, index, &bus, &fn); ++index)
-		init_rz1000 (bus, fn, "RZ1001");
+	while (dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_PD_PCTECH_RZ1000, dev))
+		init_rz1000 (dev, "RZ1000");
+	while (dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_PD_PCTECH_RZ1001, dev))
+		init_rz1000 (dev, "RZ1001");
 }
 
 #endif CONFIG_BLK_DEV_IDEPCI

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov