]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/common/saa7146_core.c
SG: Change sg_set_page() to take length and offset argument
[linux-2.6-omap-h63xx.git] / drivers / media / common / saa7146_core.c
index 365a22118a0914c3eb3102af30463694e7cdb6c1..cb034ead95ab8e5b88d2867cecdf7a7d5fe566fc 100644 (file)
@@ -112,13 +112,13 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
        sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
        if (NULL == sglist)
                return NULL;
+       sg_init_table(sglist, nr_pages);
        for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
                pg = vmalloc_to_page(virt);
                if (NULL == pg)
                        goto err;
                BUG_ON(PageHighMem(pg));
-               sglist[i].page   = pg;
-               sglist[i].length = PAGE_SIZE;
+               sg_set_page(&sglist[i], pg, PAGE_SIZE, 0);
        }
        return sglist;