summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi DOYU <hdoyu@nvidia.com>2012-07-09 11:24:57 +0300
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-07-11 06:37:43 -0700
commit6cbf4c7465b7b70936cb422b509da0ad0829c306 (patch)
tree89cb91fd31b9fe3275b192106355b908257c5bec
parentf938865b63a8a34a073e2bb366aeff1d4af6890a (diff)
ARM: tegra: iovmm: Allow alloc_client to take struct device
Allow tegra_iovmm_alloc_client() to take struct device * instead of const char *name w/ __tegra_iovmm_alloc_client(). This is necessary to support IOVMM and IOMMU simultaneously. Change-Id: I18df5001bfe0ece8f9f15b636eb11def9f228dfb Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/114215 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/include/mach/iovmm.h11
-rw-r--r--arch/arm/mach-tegra/iovmm.c2
-rw-r--r--drivers/video/tegra/nvmap/nvmap_dev.c2
3 files changed, 11 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/include/mach/iovmm.h b/arch/arm/mach-tegra/include/mach/iovmm.h
index fd83a326e129..ff94e4751a75 100644
--- a/arch/arm/mach-tegra/include/mach/iovmm.h
+++ b/arch/arm/mach-tegra/include/mach/iovmm.h
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/include/mach/iovmm.h
*
- * Copyright (c) 2010-2011, NVIDIA Corporation.
+ * Copyright (c) 2010-2012, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -140,9 +140,16 @@ struct tegra_iovmm_area_ops {
* called by clients to allocate an I/O VMM client mapping context which
* will be shared by all clients in the same share_group
*/
-struct tegra_iovmm_client *tegra_iovmm_alloc_client(const char *name,
+struct tegra_iovmm_client *__tegra_iovmm_alloc_client(const char *name,
const char *share_group, struct miscdevice *misc_dev);
+static inline struct tegra_iovmm_client *tegra_iovmm_alloc_client(
+ struct device *dev, const char *share_group,
+ struct miscdevice *misc_dev)
+{
+ return __tegra_iovmm_alloc_client(dev_name(dev), share_group, misc_dev);
+}
+
size_t tegra_iovmm_get_vm_size(struct tegra_iovmm_client *client);
void tegra_iovmm_free_client(struct tegra_iovmm_client *client);
diff --git a/arch/arm/mach-tegra/iovmm.c b/arch/arm/mach-tegra/iovmm.c
index 6112128cb743..86a92aec2d28 100644
--- a/arch/arm/mach-tegra/iovmm.c
+++ b/arch/arm/mach-tegra/iovmm.c
@@ -805,7 +805,7 @@ void tegra_iovmm_free_client(struct tegra_iovmm_client *client)
mutex_unlock(&iovmm_group_list_lock);
}
-struct tegra_iovmm_client *tegra_iovmm_alloc_client(const char *name,
+struct tegra_iovmm_client *__tegra_iovmm_alloc_client(const char *name,
const char *share_group, struct miscdevice *misc_dev)
{
struct tegra_iovmm_client *c = kzalloc(sizeof(*c), GFP_KERNEL);
diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c
index aed98f574001..758bc3d8cba0 100644
--- a/drivers/video/tegra/nvmap/nvmap_dev.c
+++ b/drivers/video/tegra/nvmap/nvmap_dev.c
@@ -1190,7 +1190,7 @@ static int nvmap_probe(struct platform_device *pdev)
#endif
dev->iovmm_master.iovmm =
- tegra_iovmm_alloc_client(dev_name(&pdev->dev), NULL,
+ tegra_iovmm_alloc_client(&pdev->dev, NULL,
&(dev->dev_user));
#ifdef CONFIG_TEGRA_IOVMM
if (!dev->iovmm_master.iovmm) {