video: tegra: nvmap: remove unused _nvmap_pin
Krishna Reddy [Fri, 6 Sep 2013 00:26:53 +0000 (17:26 -0700)]
remove unused _nvmap_pin function

Change-Id: I3ec0f4a32571a169ee2a370c59d31c456d494aa0
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/271141
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/video/tegra/nvmap/nvmap.c
drivers/video/tegra/nvmap/nvmap_priv.h

index 2fa2334..e75f542 100644 (file)
@@ -432,32 +432,10 @@ err_out:
        return ret;
 }
 
-/*
- * Pin handle without slow validation step
- */
-int _nvmap_pin(struct nvmap_client *client, struct nvmap_handle_ref *ref,
-              phys_addr_t *phys)
-{
-       int ret = 0;
-
-       if (!virt_addr_valid(client) ||
-           !virt_addr_valid(ref) ||
-           !virt_addr_valid(ref->handle) ||
-           !phys)
-               return -EINVAL;
-
-       atomic_inc(&ref->pin);
-       ret = __nvmap_pin(client, ref->handle, phys);
-       if (ret)
-               atomic_dec(&ref->pin);
-
-       return ret;
-}
-
 int nvmap_pin(struct nvmap_client *client, struct nvmap_handle_ref *ref,
              phys_addr_t *phys)
 {
-       struct nvmap_handle *h;
+       int ret = 0;
 
        if (!virt_addr_valid(client) ||
            !virt_addr_valid(ref) ||
@@ -466,11 +444,15 @@ int nvmap_pin(struct nvmap_client *client, struct nvmap_handle_ref *ref,
 
        nvmap_ref_lock(client);
        ref = __nvmap_validate_id_locked(client, (unsigned long)ref->handle);
-       if (ref)
-               h = ref->handle;
        nvmap_ref_unlock(client);
+       if (!ref)
+               return -EINVAL;
 
-       return _nvmap_pin(client, ref, phys);
+       atomic_inc(&ref->pin);
+       ret = __nvmap_pin(client, ref->handle, phys);
+       if (ret)
+               atomic_dec(&ref->pin);
+       return ret;
 }
 EXPORT_SYMBOL(nvmap_pin);
 
index c055074..8cd4174 100644 (file)
@@ -323,9 +323,6 @@ void nvmap_handle_add(struct nvmap_device *dev, struct nvmap_handle *h);
 
 int is_nvmap_vma(struct vm_area_struct *vma);
 
-int _nvmap_pin(struct nvmap_client *c, struct nvmap_handle_ref *r, 
-       phys_addr_t *phys);
-
 void nvmap_unpin_handles(struct nvmap_client *client,
                         struct nvmap_handle **h, int nr);