diff options
author | Yunhee Seo <yuni.seo@samsung.com> | 2024-04-09 20:12:04 +0900 |
---|---|---|
committer | Yunhee Seo <yuni.seo@samsung.com> | 2024-04-09 20:12:04 +0900 |
commit | 4d5931d8563a84b0ebf7b1c6d4f51cb2d9efcf29 (patch) | |
tree | a9fa13c8f1a6508a7806dbb2dd46291aed6dd648 | |
parent | 5c0a12295e9ebdc6854c770a34e797dc74f8b4bb (diff) | |
download | device-emulator-4d5931d8563a84b0ebf7b1c6d4f51cb2d9efcf29.tar.gz device-emulator-4d5931d8563a84b0ebf7b1c6d4f51cb2d9efcf29.tar.bz2 device-emulator-4d5931d8563a84b0ebf7b1c6d4f51cb2d9efcf29.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.
Change-Id: Id0337c23e69d47241612f4b22e1de71bc3bb9c1a
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
-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 2ce3968..6f728d0 100644 --- a/hw/display/display.c +++ b/hw/display/display.c @@ -98,16 +98,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; } @@ -126,4 +129,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, }; |