]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/agp/sgi-agp.c
[AGPGART] Fix sparse warning in sgi-agp.c
[linux-2.6-omap-h63xx.git] / drivers / char / agp / sgi-agp.c
index d73be4c2db8a9c5c6fffe250d36e2e3593ac53f5..cda608c42bea35e9fd7ed8f79f50ef1e9b8412ad 100644 (file)
@@ -47,9 +47,8 @@ static void *sgi_tioca_alloc_page(struct agp_bridge_data *bridge)
 
        nid = info->ca_closest_node;
        page = alloc_pages_node(nid, GFP_KERNEL, 0);
-       if (page == NULL) {
-               return 0;
-       }
+       if (!page)
+               return NULL;
 
        get_page(page);
        SetPageLocked(page);
@@ -247,7 +246,7 @@ static struct agp_bridge_data *sgi_tioca_find_bridge(struct pci_dev *pdev)
        return bridge;
 }
 
-struct agp_bridge_driver sgi_tioca_driver = {
+const struct agp_bridge_driver sgi_tioca_driver = {
        .owner = THIS_MODULE,
        .size_type = U16_APER_SIZE,
        .configure = sgi_tioca_configure,
@@ -265,6 +264,7 @@ struct agp_bridge_driver sgi_tioca_driver = {
        .free_by_type = agp_generic_free_by_type,
        .agp_alloc_page = sgi_tioca_alloc_page,
        .agp_destroy_page = agp_generic_destroy_page,
+       .agp_type_to_mask_type  = agp_generic_type_to_mask_type,
        .cant_use_aperture = 1,
        .needs_scratch_page = 0,
        .num_aperture_sizes = 1,
@@ -281,10 +281,11 @@ static int __devinit agp_sgi_init(void)
        else
                return 0;
 
-       sgi_tioca_agp_bridges =
-           (struct agp_bridge_data **)kmalloc(tioca_gart_found *
-                                              sizeof(struct agp_bridge_data *),
-                                              GFP_KERNEL);
+       sgi_tioca_agp_bridges = kmalloc(tioca_gart_found *
+                                       sizeof(struct agp_bridge_data *),
+                                       GFP_KERNEL);
+       if (!sgi_tioca_agp_bridges)
+               return -ENOMEM;
 
        j = 0;
        list_for_each_entry(info, &tioca_list, ca_list) {