summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2015-12-24 23:01:08 +0000
committerRussell King <rmk@arm.linux.org.uk>2015-12-24 23:03:05 +0000
commitc84e9921e4f47507b0be85ab976e57d342d8ddab (patch)
tree2f127242728c290bbb189161a465533f86f76ce8
parentfc552259bc0f30782c65e1fba0d9174c0e26bfe0 (diff)
common: add bo cache pointer to free method
Add a bo cache pointer to the free method, so that if we embed the bo_cache structure inside another structure, the free method can access the parent structure. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--common/bo-cache.c2
-rw-r--r--common/bo-cache.h2
-rw-r--r--etnaviv/etnadrm.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/common/bo-cache.c b/common/bo-cache.c
index 6312f8f..45774fb 100644
--- a/common/bo-cache.c
+++ b/common/bo-cache.c
@@ -105,7 +105,7 @@ void bo_cache_clean(struct bo_cache *cache, time_t time)
xorg_list_del(&entry->bucket_node);
xorg_list_del(&entry->free_node);
- cache->free(entry);
+ cache->free(cache, entry);
}
}
diff --git a/common/bo-cache.h b/common/bo-cache.h
index 7d72e6c..20d3936 100644
--- a/common/bo-cache.h
+++ b/common/bo-cache.h
@@ -12,7 +12,7 @@
struct bo_cache;
struct bo_entry;
-typedef void bo_free_fn_t(struct bo_entry *);
+typedef void bo_free_fn_t(struct bo_cache *, struct bo_entry *);
struct bo_bucket {
struct xorg_list head;
diff --git a/etnaviv/etnadrm.c b/etnaviv/etnadrm.c
index bdb40c6..ce82fe9 100644
--- a/etnaviv/etnadrm.c
+++ b/etnaviv/etnadrm.c
@@ -35,7 +35,7 @@ static struct etna_viv_conn *to_etna_viv_conn(struct viv_conn *conn)
return container_of(conn, struct etna_viv_conn, conn);
}
-static void etna_bo_cache_free(struct bo_entry *be);
+static void etna_bo_cache_free(struct bo_cache *bc, struct bo_entry *be);
struct chip_specs {
uint32_t param;
@@ -371,7 +371,7 @@ static void etna_bo_free(struct etna_bo *bo)
free(bo);
}
-static void etna_bo_cache_free(struct bo_entry *be)
+static void etna_bo_cache_free(struct bo_cache *bc, struct bo_entry *be)
{
etna_bo_free(container_of(be, struct etna_bo, cache));
}