diff options
author | Yunmi Ha <yunmi.ha@samsung.com> | 2021-04-20 14:15:03 +0900 |
---|---|---|
committer | Yunmi Ha <yunmi.ha@samsung.com> | 2021-04-20 14:15:03 +0900 |
commit | 4e422be0d3d06691132d9a007d2b39c21e871a60 (patch) | |
tree | 06aa081c914b5a17f82d919183a92c83523a9b94 /src | |
parent | 4a418cb678c7e75c03b9894176ad63bc15819839 (diff) | |
download | sensor-tm1-4e422be0d3d06691132d9a007d2b39c21e871a60.tar.gz sensor-tm1-4e422be0d3d06691132d9a007d2b39c21e871a60.tar.bz2 sensor-tm1-4e422be0d3d06691132d9a007d2b39c21e871a60.zip |
Use system error instaed of sensor_error_e
Change-Id: Ib1d298e14fa5efb9eb72819ce6980beb0ad7c295
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/accel/accel_device.cpp | 10 | ||||
-rwxr-xr-x | src/proxi/proxi_device.cpp | 10 | ||||
-rwxr-xr-x | src/sensorhub/sensorhub.cpp | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/accel/accel_device.cpp b/src/accel/accel_device.cpp index fc4bf2b..12e9af8 100755 --- a/src/accel/accel_device.cpp +++ b/src/accel/accel_device.cpp @@ -144,7 +144,7 @@ int accel_device::get_poll_fd(void) int accel_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = &sensor_info; return 1; @@ -313,7 +313,7 @@ bool accel_device::update_value_iio(void) int accel_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value()) { _D("Failed to update value"); @@ -331,9 +331,9 @@ int accel_device::read_fd(uint32_t **ids) int accel_device::get_data(uint32_t id, sensor_data_t **data, int *length) { sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = new (std::nothrow) sensor_data_t; retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/proxi/proxi_device.cpp b/src/proxi/proxi_device.cpp index 520df51..eb67102 100755 --- a/src/proxi/proxi_device.cpp +++ b/src/proxi/proxi_device.cpp @@ -126,7 +126,7 @@ int proxi_device::get_poll_fd(void) int proxi_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = &sensor_info; return 1; @@ -182,7 +182,7 @@ bool proxi_device::update_value_input_event(void) int proxi_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value()) { _D("Failed to update value"); @@ -200,9 +200,9 @@ int proxi_device::read_fd(uint32_t **ids) int proxi_device::get_data(uint32_t id, sensor_data_t **data, int *length) { sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = new (std::nothrow) sensor_data_t; retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/sensorhub/sensorhub.cpp b/src/sensorhub/sensorhub.cpp index 0d90e7b..0d61e7f 100755 --- a/src/sensorhub/sensorhub.cpp +++ b/src/sensorhub/sensorhub.cpp @@ -58,7 +58,7 @@ int sensorhub_device::get_sensors(const sensor_info_t **sensors) { int size; - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "sensorhub_device:NULL interface"); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "sensorhub_device:NULL interface"); size = manager->get_sensors(sensors); return size; @@ -185,7 +185,7 @@ bool sensorhub_device::set_attribute_str(uint32_t id, int32_t attribute, char *v int sensorhub_device::read_fd(uint32_t **ids) { sensorhub_data_t data; - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); // step 1 if (!controller->read_fd(data)) return 0; @@ -223,9 +223,9 @@ int sensorhub_device::read_fd(uint32_t **ids) int sensorhub_device::get_data(uint32_t id, sensor_data_t **data, int *length) { int remains = 1; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensorhub_sensor *sensor = manager->get_sensor(id); if (!sensor) { |