]> err.no Git - linux-2.6/blobdiff - drivers/w1/masters/matrox_w1.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[linux-2.6] / drivers / w1 / masters / matrox_w1.c
index 591809cbbb97cee5a765044320095fbf091fd0ec..1550431ccb6ade0b3b1ee556d3ea809f1c125132 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/slab.h>
 #include <linux/pci_ids.h>
 #include <linux/pci.h>
-#include <linux/timer.h>
 
 #include "../w1.h"
 #include "../w1_int.h"
@@ -98,7 +97,7 @@ static void matrox_w1_write_ddc_bit(void *, u8);
  *
  * 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.
+ * since we don't know motherboard schema, which has pretty unused(may be not) GPIO.
  *
  * I've heard that PIIX also has open drain pin.
  *
@@ -164,7 +163,7 @@ static int __devinit matrox_w1_probe(struct pci_dev *pdev, const struct pci_devi
        if (pdev->vendor != PCI_VENDOR_ID_MATROX || pdev->device != PCI_DEVICE_ID_MATROX_G400)
                return -ENODEV;
 
-       dev = kmalloc(sizeof(struct matrox_device) +
+       dev = kzalloc(sizeof(struct matrox_device) +
                       sizeof(struct w1_bus_master), GFP_KERNEL);
        if (!dev) {
                dev_err(&pdev->dev,
@@ -173,7 +172,6 @@ static int __devinit matrox_w1_probe(struct pci_dev *pdev, const struct pci_devi
                return -ENOMEM;
        }
 
-       memset(dev, 0, sizeof(struct matrox_device) + sizeof(struct w1_bus_master));
 
        dev->bus_master = (struct w1_bus_master *)(dev + 1);
 
@@ -215,6 +213,8 @@ static int __devinit matrox_w1_probe(struct pci_dev *pdev, const struct pci_devi
        return 0;
 
 err_out_free_device:
+       if (dev->virt_addr)
+               iounmap(dev->virt_addr);
        kfree(dev);
 
        return err;