Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[powerpc.git] / drivers / char / agp / ati-agp.c
index e572ced..fbd4155 100644 (file)
@@ -6,6 +6,8 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/string.h>
+#include <linux/slab.h>
 #include <linux/agp_backend.h>
 #include <asm/agp.h>
 #include "agp.h"
@@ -116,14 +118,12 @@ static int ati_create_gatt_pages(int nr_tables)
        int retval = 0;
        int i;
 
-       tables = kmalloc((nr_tables + 1) * sizeof(ati_page_map *),
-                        GFP_KERNEL);
+       tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL);
        if (tables == NULL)
                return -ENOMEM;
 
-       memset(tables, 0, sizeof(ati_page_map *) * (nr_tables + 1));
        for (i = 0; i < nr_tables; i++) {
-               entry = kmalloc(sizeof(ati_page_map), GFP_KERNEL);
+               entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL);
                if (entry == NULL) {
                        while (i>0) {
                                kfree (tables[i-1]);
@@ -134,7 +134,6 @@ static int ati_create_gatt_pages(int nr_tables)
                        retval = -ENOMEM;
                        break;
                }
-               memset(entry, 0, sizeof(ati_page_map));
                tables[i] = entry;
                retval = ati_create_page_map(entry);
                if (retval != 0) break;
@@ -522,6 +521,7 @@ static struct pci_device_id agp_ati_pci_table[] = {
 MODULE_DEVICE_TABLE(pci, agp_ati_pci_table);
 
 static struct pci_driver agp_ati_pci_driver = {
+       .owner          = THIS_MODULE,
        .name           = "agpgart-ati",
        .id_table       = agp_ati_pci_table,
        .probe          = agp_ati_probe,