struct bt_notification_inactivity *notification;
struct bt_notification *ret_notif = NULL;
- if (!cc_prio_map) {
- BT_LOGW_STR("Invalid parameter: clock class priority map is NULL.");
- goto error;
+ if (cc_prio_map) {
+ /* Function's reference, released at the end */
+ bt_get(cc_prio_map);
+ } else {
+ cc_prio_map = bt_clock_class_priority_map_create();
+ if (!cc_prio_map) {
+ BT_LOGE_STR("Cannot create empty clock class priority map.");
+ goto error;
+ }
}
BT_LOGD("Creating inactivity notification object: "
BT_PUT(ret_notif);
end:
+ bt_put(cc_prio_map);
return ret_notif;
}
return cc_prio_map;
}
-struct bt_ctf_clock_value *bt_notification_inactivity_get_clock_value(
+struct bt_clock_value *bt_notification_inactivity_get_clock_value(
struct bt_notification *notification,
- struct bt_ctf_clock_class *clock_class)
+ struct bt_clock_class *clock_class)
{
- struct bt_ctf_clock_value *clock_value = NULL;
+ struct bt_clock_value *clock_value = NULL;
struct bt_notification_inactivity *inactivity_notification;
if (!notification) {
int bt_notification_inactivity_set_clock_value(
struct bt_notification *notification,
- struct bt_ctf_clock_value *clock_value)
+ struct bt_clock_value *clock_value)
{
int ret = 0;
uint64_t prio;
- struct bt_ctf_clock_class *clock_class = NULL;
+ struct bt_clock_class *clock_class = NULL;
struct bt_notification_inactivity *inactivity_notification;
if (!notification) {
"addr%p, notif-type=%s",
notification, bt_notification_type_string(
bt_notification_get_type(notification)));
+ ret = -1;
goto end;
}
inactivity_notification = container_of(notification,
struct bt_notification_inactivity, parent);
- clock_class = bt_ctf_clock_value_get_class(clock_value);
+ clock_class = bt_clock_value_get_class(clock_value);
ret = bt_clock_class_priority_map_get_clock_class_priority(
inactivity_notification->cc_prio_map, clock_class, &prio);
if (ret) {
"clock-value-addr=%p",
inactivity_notification,
inactivity_notification->cc_prio_map,
- clock_class, bt_ctf_clock_class_get_name(clock_class),
+ clock_class, bt_clock_class_get_name(clock_class),
clock_value);
+ ret = -1;
goto end;
}
"clock-value-addr=%p",
inactivity_notification,
inactivity_notification->cc_prio_map,
- clock_class, bt_ctf_clock_class_get_name(clock_class),
+ clock_class, bt_clock_class_get_name(clock_class),
clock_value);
end: