atomisp: remove hmm_load/store/clear indirections
authorAlan Cox <alan@linux.intel.com>
Fri, 28 Apr 2017 12:10:01 +0000 (13:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Apr 2017 12:27:26 +0000 (14:27 +0200)
We have a layer of un-needed wrapping here that can go. In addition there are
some functions that don't exist and one that isn't used which can also go.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c
drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.c
drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.h
drivers/staging/media/atomisp/pci/atomisp2/hrt/memory_access.c

index a8614a9a5dd9bea8731cd0a924b44f060ffad2bc..97093baf28ac9a46043188511dd5f49990154bf8 100644 (file)
@@ -2922,7 +2922,7 @@ int atomisp_get_metadata(struct atomisp_sub_device *asd, int flag,
                                   md_buf->md_vptr,
                                   stream_info->metadata_info.size);
        } else {
-               hrt_isp_css_mm_load(md_buf->metadata->address,
+               hmm_load(md_buf->metadata->address,
                                    asd->params.metadata_user[md_type],
                                    stream_info->metadata_info.size);
 
@@ -3005,7 +3005,7 @@ int atomisp_get_metadata_by_type(struct atomisp_sub_device *asd, int flag,
                                   md_buf->md_vptr,
                                   stream_info->metadata_info.size);
        } else {
-               hrt_isp_css_mm_load(md_buf->metadata->address,
+               hmm_load(md_buf->metadata->address,
                                    asd->params.metadata_user[md_type],
                                    stream_info->metadata_info.size);
 
index e5a7407bf7ab054166c7cf05a7e8e7be0273e13b..7ce8803cf6f90f4c4f670708b3be7f0552f2ae28 100644 (file)
@@ -1144,11 +1144,11 @@ static int remove_pad_from_frame(struct atomisp_device *isp,
 
        load += ISP_LEFT_PAD;
        for (i = 0; i < height; i++) {
-               ret = hrt_isp_css_mm_load(load, buffer, width*sizeof(load));
+               ret = hmm_load(load, buffer, width*sizeof(load));
                if (ret < 0)
                        goto remove_pad_error;
 
-               ret = hrt_isp_css_mm_store(store, buffer, width*sizeof(store));
+               ret = hmm_store(store, buffer, width*sizeof(store));
                if (ret < 0)
                        goto remove_pad_error;
 
index f8fc14c79aa79ef94df671f7c5839957f9675d6e..282075942ba6dd3f9a07df0a78b661e9029ee3a6 100644 (file)
@@ -52,22 +52,23 @@ mmgr_calloc(const size_t N, const size_t size)
        return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED);
 }
 
-void
-mmgr_clear(hrt_vaddress vaddr, const size_t size)
+void mmgr_clear(hrt_vaddress vaddr, const size_t size)
 {
-       hrt_isp_css_mm_set(vaddr, 0, size);
+       if (vaddr)
+               hmm_set(vaddr, 0, size);
 }
 
-void
-mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
+void mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
 {
-       hrt_isp_css_mm_load(vaddr, data, size);
+       if (vaddr && data)
+               hmm_load(vaddr, data, size);
 }
 
 void
 mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size)
 {
-       hrt_isp_css_mm_store(vaddr, data, size);
+       if (vaddr && data)
+               hmm_store(vaddr, data, size);
 }
 
 hrt_vaddress
index 63904bcc5e721253f4a1e3e8fa3836de554df2d7..7dff22f59e29ff98b9e3c44055ad5ed980834f00 100644 (file)
 
 #define __page_align(size)     (((size) + (PAGE_SIZE-1)) & (~(PAGE_SIZE-1)))
 
-int hrt_isp_css_mm_set(ia_css_ptr virt_addr, int c, size_t bytes)
-{
-       if (virt_addr)
-               return hmm_set(virt_addr, c, bytes);
-
-       return -EFAULT;
-}
-
-int hrt_isp_css_mm_load(ia_css_ptr virt_addr, void *data, size_t bytes)
-{
-       if (virt_addr && data)
-               return hmm_load(virt_addr, data, bytes);
-       return -EFAULT;
-}
-
-int hrt_isp_css_mm_store(ia_css_ptr virt_addr, const void *data, size_t bytes)
-{
-       if (virt_addr && data)
-               return hmm_store(virt_addr, data, bytes);
-       return -EFAULT;
-}
-
 static void *my_userptr;
 static unsigned my_num_pages;
 static enum hrt_userptr_type my_usr_type;
@@ -149,8 +127,3 @@ ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes)
        return ptr;
 }
 
-phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr)
-{
-       return hmm_virt_to_phys(virt_addr);
-}
-
index 3fe9247c78ac841bdd8119c5589e6d4864da9ba2..1328944a7afd3b3c43fd8d2b2b63d66ed7f929bc 100644 (file)
@@ -44,8 +44,6 @@ struct hrt_userbuffer_attr {
 void hrt_isp_css_mm_set_user_ptr(void *userptr,
                                unsigned int num_pages, enum hrt_userptr_type);
 
-int hrt_isp_css_mm_set(ia_css_ptr virt_addr, int c, size_t bytes);
-
 /* Allocate memory, returns a virtual address */
 ia_css_ptr hrt_isp_css_mm_alloc(size_t bytes);
 ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes, void *userptr,
@@ -59,22 +57,4 @@ ia_css_ptr hrt_isp_css_mm_alloc_cached(size_t bytes);
 ia_css_ptr hrt_isp_css_mm_calloc(size_t bytes);
 ia_css_ptr hrt_isp_css_mm_calloc_cached(size_t bytes);
 
-/* Store data to a virtual address */
-int hrt_isp_css_mm_load(ia_css_ptr virt_addr, void *data, size_t bytes);
-
-/* Load data from a virtual address */
-int hrt_isp_css_mm_store(ia_css_ptr virt_addr, const void *data, size_t bytes);
-
-int hrt_isp_css_mm_load_int(ia_css_ptr virt_addr, int *data);
-int hrt_isp_css_mm_load_short(ia_css_ptr virt_addr, short *data);
-int hrt_isp_css_mm_load_char(ia_css_ptr virt_addr, char *data);
-
-int hrt_isp_css_mm_store_char(ia_css_ptr virt_addr, char data);
-int hrt_isp_css_mm_store_short(ia_css_ptr virt_addr, short data);
-int hrt_isp_css_mm_store_int(ia_css_ptr virt_addr, int data);
-
-/* translate a virtual to a physical address, used to program
-   the display driver on  the FPGA system */
-phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr);
-
 #endif /* _hive_isp_css_mm_hrt_h_ */
index 6c7f38d736bba3ba03b1140dcc60c2195fb81b6c..60e70cbddfe806d222655c02db8265f2ef272f36 100644 (file)
@@ -89,15 +89,15 @@ void mmgr_clear(
        ia_css_ptr                      vaddr,
        const size_t                    size)
 {
-       hrt_isp_css_mm_set(vaddr, 0, size);
+       hmm_set(vaddr, 0, size);
 }
 
 void mmgr_load(const ia_css_ptr        vaddr, void *data, const size_t size)
 {
-       hrt_isp_css_mm_load(vaddr, data, size);
+       hmm_load(vaddr, data, size);
 }
 
 void mmgr_store(const ia_css_ptr vaddr,        const void *data, const size_t size)
 {
-       hrt_isp_css_mm_store(vaddr, data, size);
+       hmm_store(vaddr, data, size);
 }