summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2017-04-28 13:09:23 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-28 14:27:25 +0200
commitec58cbed3f8879ae9d9447f49ff3cd57f315f5d8 (patch)
tree3d9c3e7d55851e56a3c3349100cda466bfaaf94b
parent92ac903a9c5f2f2b20b12c094fdcd1aaa3ff3410 (diff)
atomisp: handle allocation calls before init in the hmm layer
Currently the code handles this in the abstraction above. We want to remove that abstraction so begin by pushing down the sanity check. Unfortunately at this point we can't simply fix the init order. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index 151abf0b70b7..14537ab3d04b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -226,6 +226,11 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
struct hmm_buffer_object *bo;
int ret;
+ /* Check if we are initialized. In the ideal world we wouldn't need
+ this but we can tackle it once the driver is a lot cleaner */
+
+ if (!dummy_ptr)
+ hmm_init();
/*Get page number from size*/
pgnr = size_to_pgnr_ceil(bytes);