diff options
author | Yunhee Seo <yuni.seo@samsung.com> | 2024-03-18 18:07:27 +0900 |
---|---|---|
committer | Yunhee Seo <yuni.seo@samsung.com> | 2024-04-04 10:47:40 +0900 |
commit | 381b3432252813549b510846e0699fde9eff53bc (patch) | |
tree | 7f1a40a3edde537c111a25716f8933a0fbace7e9 | |
parent | b15a79f61e0f35b492ea4b48c2a6a2d7bcb9523f (diff) | |
download | device-rpi-381b3432252813549b510846e0699fde9eff53bc.tar.gz device-rpi-381b3432252813549b510846e0699fde9eff53bc.tar.bz2 device-rpi-381b3432252813549b510846e0699fde9eff53bc.zip |
display: Apply HAL ABI versioning
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-display side.
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Change-Id: I6c77e6cee028ea987f9fa43c2869913b464b1e9a
-rw-r--r-- | hw/display/display.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/hw/display/display.c b/hw/display/display.c index ede269a..f6576fa 100644 --- a/hw/display/display.c +++ b/hw/display/display.c @@ -102,16 +102,19 @@ static int display_init(void **data) { hal_backend_device_display_funcs *device_display_funcs; - device_display_funcs = calloc(1, sizeof(hal_backend_device_display_funcs)); + if (!data) { + _E("Invalid parameter"); + return -EINVAL; + } + + device_display_funcs = *(hal_backend_device_display_funcs **) data; if (!device_display_funcs) - return -ENOMEM; + return -EINVAL; device_display_funcs->get_max_brightness = display_get_max_brightness; device_display_funcs->get_brightness = display_get_brightness; device_display_funcs->set_brightness = display_set_brightness; - *data = (void *)device_display_funcs; - return 0; } @@ -130,4 +133,6 @@ hal_backend EXPORT hal_backend_device_display_data = { .abi_version = HAL_ABI_VERSION_TIZEN_7_0, .init = display_init, .exit = display_exit, + .major_version = 1, + .minor_version = 0, }; |