diff options
Diffstat (limited to 'drivers/video/b2r2/b2r2_node_gen.c')
-rw-r--r-- | drivers/video/b2r2/b2r2_node_gen.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/video/b2r2/b2r2_node_gen.c b/drivers/video/b2r2/b2r2_node_gen.c index f452a4b11df..1f48bac6fe7 100644 --- a/drivers/video/b2r2/b2r2_node_gen.c +++ b/drivers/video/b2r2/b2r2_node_gen.c @@ -15,7 +15,8 @@ #include <asm/dma-mapping.h> #include "b2r2_internal.h" -static void free_nodes(struct b2r2_node *first_node) +static void free_nodes(struct b2r2_control *cont, + struct b2r2_node *first_node) { struct b2r2_node *node = first_node; int no_of_nodes = 0; @@ -25,34 +26,35 @@ static void free_nodes(struct b2r2_node *first_node) node = node->next; } - dma_free_coherent(b2r2_blt_device(), - no_of_nodes * sizeof(struct b2r2_node), - first_node, - first_node->physical_address - - offsetof(struct b2r2_node, node)); + dma_free_coherent(cont->dev, + no_of_nodes * sizeof(struct b2r2_node), + first_node, + first_node->physical_address - + offsetof(struct b2r2_node, node)); } -struct b2r2_node *b2r2_blt_alloc_nodes(int no_of_nodes) +struct b2r2_node *b2r2_blt_alloc_nodes(struct b2r2_control *cont, + int no_of_nodes) { u32 physical_address; struct b2r2_node *nodes; struct b2r2_node *tmpnode; if (no_of_nodes <= 0) { - dev_err(b2r2_blt_device(), "%s: Wrong number of nodes (%d)", - __func__, no_of_nodes); + dev_err(cont->dev, "%s: Wrong number of nodes (%d)", + __func__, no_of_nodes); return NULL; } /* Allocate the memory */ - nodes = (struct b2r2_node *) dma_alloc_coherent(b2r2_blt_device(), - no_of_nodes * sizeof(struct b2r2_node), - &physical_address, GFP_DMA | GFP_KERNEL); + nodes = (struct b2r2_node *) dma_alloc_coherent(cont->dev, + no_of_nodes * sizeof(struct b2r2_node), + &physical_address, GFP_DMA | GFP_KERNEL); if (nodes == NULL) { - dev_err(b2r2_blt_device(), - "%s: Failed to alloc memory for nodes", - __func__); + dev_err(cont->dev, + "%s: Failed to alloc memory for nodes", + __func__); return NULL; } @@ -73,8 +75,9 @@ struct b2r2_node *b2r2_blt_alloc_nodes(int no_of_nodes) return nodes; } -void b2r2_blt_free_nodes(struct b2r2_node *first_node) +void b2r2_blt_free_nodes(struct b2r2_control *cont, + struct b2r2_node *first_node) { - free_nodes(first_node); + free_nodes(cont, first_node); } |