- head = list_entry(layout->llot_comp_list.next, typeof(*head),
- llc_list);
- tail = list_entry(layout->llot_comp_list.prev, typeof(*tail),
- llc_list);
-
- if (pos == LLAPI_LAYOUT_COMP_POS_NEXT) {
- if (comp == tail)
+ head = list_entry(layout->llot_comp_list.next, typeof(*head), llc_list);
+ tail = list_entry(layout->llot_comp_list.prev, typeof(*tail), llc_list);
+ switch (pos) {
+ case LLAPI_LAYOUT_COMP_USE_FIRST:
+ layout->llot_cur_comp = head;
+ break;
+ case LLAPI_LAYOUT_COMP_USE_NEXT:
+ if (comp == tail) {
+ errno = ENOENT;