Don't use mali error defines, it'a ugly.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
/* 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);
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;
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)
* 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
*
* @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
#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;
}
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);
dma_set_mask_failed:
free_platform:
kbasep_platform_device_term(kbdev);
-fail:
return MALI_ERROR_FUNCTION_FAILED;
}