]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/agp/amd-k7-agp.c
Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
[linux-2.6-omap-h63xx.git] / drivers / char / agp / amd-k7-agp.c
index 51d0d562d01e11bc8e457ac4a02dfbf331c2b464..df0ddf14b85cd3d695718beffae359b4581881f8 100644 (file)
@@ -101,6 +101,11 @@ static int amd_create_gatt_pages(int nr_tables)
        for (i = 0; i < nr_tables; i++) {
                entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL);
                if (entry == NULL) {
+                       while (i > 0) {
+                               kfree(tables[i-1]);
+                               i--;
+                       }
+                       kfree(tables);
                        retval = -ENOMEM;
                        break;
                }
@@ -339,7 +344,7 @@ static int amd_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
        return 0;
 }
 
-static struct aper_size_info_lvl2 amd_irongate_sizes[7] =
+static const struct aper_size_info_lvl2 amd_irongate_sizes[7] =
 {
        {2048, 524288, 0x0000000c},
        {1024, 262144, 0x0000000a},
@@ -350,12 +355,12 @@ static struct aper_size_info_lvl2 amd_irongate_sizes[7] =
        {32, 8192, 0x00000000}
 };
 
-static struct gatt_mask amd_irongate_masks[] =
+static const struct gatt_mask amd_irongate_masks[] =
 {
        {.mask = 1, .type = 0}
 };
 
-static struct agp_bridge_driver amd_irongate_driver = {
+static const struct agp_bridge_driver amd_irongate_driver = {
        .owner                  = THIS_MODULE,
        .aperture_sizes         = amd_irongate_sizes,
        .size_type              = LVL2_APER_SIZE,
@@ -376,6 +381,7 @@ static struct agp_bridge_driver amd_irongate_driver = {
        .free_by_type           = agp_generic_free_by_type,
        .agp_alloc_page         = agp_generic_alloc_page,
        .agp_destroy_page       = agp_generic_destroy_page,
+       .agp_type_to_mask_type  = agp_generic_type_to_mask_type,
 };
 
 static struct agp_device_ids amd_agp_device_ids[] __devinitdata =
@@ -456,9 +462,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
         * erratum 46: Setup violation on AGP SBA pins - Disable side band addressing.
         * With this lot disabled, we should prevent lockups. */
        if (agp_bridge->dev->device == PCI_DEVICE_ID_AMD_FE_GATE_700E) {
-               u8 revision=0;
-               pci_read_config_byte(pdev, PCI_REVISION_ID, &revision);
-               if (revision == 0x10 || revision == 0x11) {
+               if (pdev->revision == 0x10 || pdev->revision == 0x11) {
                        agp_bridge->flags = AGP_ERRATA_FASTWRITES;
                        agp_bridge->flags |= AGP_ERRATA_SBA;
                        agp_bridge->flags |= AGP_ERRATA_1X;