linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / w1 / matrox_w1.c
index 55b1faf..0b03f8f 100644 (file)
@@ -1,8 +1,8 @@
 /*
- *     matrox_w1.c
+ *     matrox_w1.c
  *
  * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
- * 
+ *
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,8 +22,8 @@
 #include <asm/atomic.h>
 #include <asm/types.h>
 #include <asm/io.h>
-#include <asm/delay.h>
 
+#include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/list.h>
@@ -59,7 +59,7 @@ static struct pci_driver matrox_w1_pci_driver = {
        .remove = __devexit_p(matrox_w1_remove),
 };
 
-/* 
+/*
  * Matrox G400 DDC registers.
  */
 
@@ -78,11 +78,13 @@ static struct pci_driver matrox_w1_pci_driver = {
 
 struct matrox_device
 {
-       unsigned long base_addr;
-       unsigned long port_index, port_data;
+       void __iomem *base_addr;
+       void __iomem *port_index;
+       void __iomem *port_data;
        u8 data_mask;
 
-       unsigned long phys_addr, virt_addr;
+       unsigned long phys_addr;
+       void __iomem *virt_addr;
        unsigned long found;
 
        struct w1_bus_master *bus_master;
@@ -94,7 +96,7 @@ static void matrox_w1_write_ddc_bit(unsigned long, u8);
 /*
  * These functions read and write DDC Data bit.
  *
- * Using tristate pins, since i can't  fin any open-drain pin in whole motherboard.
+ * Using tristate pins, since i can't find any open-drain pin in whole motherboard.
  * Unfortunately we can't connect to Intel's 82801xx IO controller
  * since we don't know motherboard schema, wich has pretty unused(may be not) GPIO.
  *
@@ -175,14 +177,13 @@ static int __devinit matrox_w1_probe(struct pci_dev *pdev, const struct pci_devi
 
        dev->bus_master = (struct w1_bus_master *)(dev + 1);
 
-       /* 
-        * True for G400, for some other we need resource 0, see drivers/video/matrox/matroxfb_base.c 
+       /*
+        * True for G400, for some other we need resource 0, see drivers/video/matrox/matroxfb_base.c
         */
 
        dev->phys_addr = pci_resource_start(pdev, 1);
 
-       dev->virt_addr =
-               (unsigned long) ioremap_nocache(dev->phys_addr, 16384);
+       dev->virt_addr = ioremap_nocache(dev->phys_addr, 16384);
        if (!dev->virt_addr) {
                dev_err(&pdev->dev, "%s: failed to ioremap(0x%lx, %d).\n",
                        __func__, dev->phys_addr, 16384);
@@ -227,14 +228,14 @@ static void __devexit matrox_w1_remove(struct pci_dev *pdev)
 
        if (dev->found) {
                w1_remove_master_device(dev->bus_master);
-               iounmap((void *) dev->virt_addr);
+               iounmap(dev->virt_addr);
        }
        kfree(dev);
 }
 
 static int __init matrox_w1_init(void)
 {
-       return pci_module_init(&matrox_w1_pci_driver);
+       return pci_register_driver(&matrox_w1_pci_driver);
 }
 
 static void __exit matrox_w1_fini(void)