gpu: arm: midgard: support kernel error defines for platform.
authorJoonyoung Shim <jy0922.shim@samsung.com>
Tue, 20 Jan 2015 09:07:38 +0000 (18:07 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 13 Apr 2015 10:44:18 +0000 (12:44 +0200)
Don't use mali error defines, it'a ugly.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
drivers/gpu/arm/midgard/mali_kbase.h
drivers/gpu/arm/midgard/mali_kbase_config.c
drivers/gpu/arm/midgard/mali_kbase_config.h
drivers/gpu/arm/midgard/mali_kbase_core_linux.c
drivers/gpu/arm/midgard/mali_kbase_device.c

index e94681f474af820255ff658d5c70b36678308617..5754f3125df13580a9d8a893faa222a020351018 100644 (file)
@@ -86,7 +86,7 @@ const struct list_head *kbase_dev_list_get(void);
 /* API to release the device list semaphore */
 void kbase_dev_list_put(const struct list_head *dev_list);
 
-mali_error kbase_device_init(struct kbase_device * const kbdev);
+int kbase_device_init(struct kbase_device * const kbdev);
 void kbase_device_term(struct kbase_device *kbdev);
 void kbase_device_free(struct kbase_device *kbdev);
 int kbase_device_has_feature(struct kbase_device *kbdev, u32 feature);
index 88315acf42638f41e38b72fc05eb8ec85408496e..a4ff12cecfe3fa6acaf66a4188bc27c8ace5fba5 100644 (file)
@@ -133,7 +133,7 @@ uintptr_t kbasep_get_config_value(struct kbase_device *kbdev, const struct kbase
 
 KBASE_EXPORT_TEST_API(kbasep_get_config_value)
 
-mali_bool kbasep_platform_device_init(struct kbase_device *kbdev)
+int kbasep_platform_device_init(struct kbase_device *kbdev)
 {
        struct kbase_platform_funcs_conf *platform_funcs;
 
@@ -142,7 +142,7 @@ mali_bool kbasep_platform_device_init(struct kbase_device *kbdev)
                if (platform_funcs->platform_init_func)
                        return platform_funcs->platform_init_func(kbdev);
        }
-       return MALI_TRUE;
+       return 0;
 }
 
 void kbasep_platform_device_term(struct kbase_device *kbdev)
index 3a1acf89ac7b48f98cf657191d19ea9ea92dfd5f..2c8313167560789623a579f733b2982f62e6a903 100644 (file)
@@ -450,7 +450,7 @@ typedef struct kbase_platform_funcs_conf {
         * Power Management callbacks).
         * The platform specific private pointer kbase_device::platform_context can be accessed (and possibly initialized) in here.
         */
-       mali_bool(*platform_init_func) (struct kbase_device *kbdev);
+       int (*platform_init_func)(struct kbase_device *kbdev);
        /**
         * Function pointer for platform specific termination or NULL if no termination function is required.
         * This function will be called \em after any other callbacks listed in the struct kbase_attribute struct (such as
@@ -701,7 +701,7 @@ int kbasep_get_config_attribute_count(const struct kbase_attribute *attributes);
  *
  * @return   MALI_TRUE if no errors have been found in the config. MALI_FALSE otherwise.
  */
-mali_bool kbasep_platform_device_init(struct kbase_device *kbdev);
+int kbasep_platform_device_init(struct kbase_device *kbdev);
 
 /**
  * @brief Platform specific call to terminate hardware
index d1d2d5647b786a3064c1cd04c86c49cc6a81250a..901f3c8dd96b7786d38d67c7090c2ec1e0e6d87a 100644 (file)
@@ -2971,10 +2971,12 @@ static int kbase_platform_device_probe(struct platform_device *pdev)
 #endif /* CONFIG_DEBUG_FS */
 
 
-       if (MALI_ERROR_NONE != kbase_device_init(kbdev)) {
+       err = kbase_device_init(kbdev);
+       if (err < 0 || MALI_ERROR_NONE != err) {
                dev_err(kbdev->dev, "Can't initialize device\n");
 
-               err = -ENOMEM;
+               if (err > MALI_ERROR_NONE)
+                       err = -ENOMEM;
                goto out_debugfs_remove;
        }
 
index 39043c96dbbbe3ac6866db31ec9b4031dd50e1b7..77dac87b98e4e87f311f1a0d2022a8d9d4ebabfb 100644 (file)
@@ -71,15 +71,17 @@ struct kbase_device *kbase_device_alloc(void)
        return kzalloc(sizeof(struct kbase_device), GFP_KERNEL);
 }
 
-mali_error kbase_device_init(struct kbase_device * const kbdev)
+int kbase_device_init(struct kbase_device * const kbdev)
 {
        int i;                  /* i used after the for loop, don't reuse ! */
+       int err;
 
        spin_lock_init(&kbdev->mmu_mask_change);
 
        /* Initialize platform specific context */
-       if (MALI_FALSE == kbasep_platform_device_init(kbdev))
-               goto fail;
+       err = kbasep_platform_device_init(kbdev);
+       if (err < 0)
+               return err;
 
        /* Ensure we can access the GPU registers */
        kbase_pm_register_access_enable(kbdev);
@@ -244,7 +246,6 @@ mem_lowlevel_init_failed:
 dma_set_mask_failed:
 free_platform:
        kbasep_platform_device_term(kbdev);
-fail:
        return MALI_ERROR_FUNCTION_FAILED;
 }