To support OS upgrade feature, hal-backend and hal-api module needs HAL ABI versioning.
So, major/minor version is added to hal_backend structure.
While applying HAL ABI versioning, hal_backend_[module]_funcs is allocated from hal-api-[module] side.
Thus, allocation is moved to hal-api-device-haptic side.
Change-Id: If1accb11e605c76698790111c3ec56cf1d8f6868
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
{
hal_backend_device_haptic_funcs *device_haptic_funcs;
- device_haptic_funcs = calloc(1, sizeof(hal_backend_device_haptic_funcs));
- if (!device_haptic_funcs)
- return -ENOMEM;
+ if (!data) {
+ _E("Invalid parameter");
+ return -EINVAL;
+ }
+
+ device_haptic_funcs = *(hal_backend_device_haptic_funcs **) data;
+ if (!device_haptic_funcs)
+ return -EINVAL;
device_haptic_funcs->get_device_count = get_device_count;
device_haptic_funcs->open_device = open_device;
device_haptic_funcs->stop_device = stop_device;
device_haptic_funcs->is_valid = is_valid;
- *data = (void *)device_haptic_funcs;
-
return 0;
}
.abi_version = HAL_ABI_VERSION_TIZEN_7_0,
.init = haptic_init,
.exit = haptic_exit,
+ .major_version = 1,
+ .minor_version = 0,
};