Index: uspace/lib/usbhost/src/ddf_helpers.c
===================================================================
--- uspace/lib/usbhost/src/ddf_helpers.c	(revision 4547f1115bd8270b9a1bcf3bb8d3e02111295371)
+++ uspace/lib/usbhost/src/ddf_helpers.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
@@ -91,6 +91,6 @@
 
 
-static int hcd_ddf_new_device(ddf_dev_t *device, usb_dev_t *hub, unsigned port);
-static int hcd_ddf_remove_device(ddf_dev_t *device, usb_dev_t *hub, unsigned port);
+static errno_t hcd_ddf_new_device(ddf_dev_t *device, usb_dev_t *hub, unsigned port);
+static errno_t hcd_ddf_remove_device(ddf_dev_t *device, usb_dev_t *hub, unsigned port);
 
 
@@ -107,5 +107,5 @@
  * @return Error code.
  */
-static int register_endpoint(
+static errno_t register_endpoint(
     ddf_fun_t *fun, usb_endpoint_t endpoint,
     usb_transfer_type_t transfer_type, usb_direction_t direction,
@@ -136,5 +136,5 @@
  * @return Error code.
  */
-static int unregister_endpoint(
+static errno_t unregister_endpoint(
     ddf_fun_t *fun, usb_endpoint_t endpoint, usb_direction_t direction)
 {
@@ -151,5 +151,5 @@
 }
 
-static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
+static errno_t reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
 {
 	assert(fun);
@@ -164,5 +164,5 @@
 }
 
-static int release_default_address(ddf_fun_t *fun)
+static errno_t release_default_address(ddf_fun_t *fun)
 {
 	assert(fun);
@@ -176,5 +176,5 @@
 }
 
-static int device_enumerate(ddf_fun_t *fun, unsigned port)
+static errno_t device_enumerate(ddf_fun_t *fun, unsigned port)
 {
 	assert(fun);
@@ -188,5 +188,5 @@
 }
 
-static int device_remove(ddf_fun_t *fun, unsigned port)
+static errno_t device_remove(ddf_fun_t *fun, unsigned port)
 {
 	assert(fun);
@@ -206,5 +206,5 @@
  * @return Error code.
  */
-static int get_my_device_handle(ddf_fun_t *fun, devman_handle_t *handle)
+static errno_t get_my_device_handle(ddf_fun_t *fun, devman_handle_t *handle)
 {
 	assert(fun);
@@ -224,5 +224,5 @@
  * @return Error code.
  */
-static int dev_read(ddf_fun_t *fun, usb_endpoint_t endpoint,
+static errno_t dev_read(ddf_fun_t *fun, usb_endpoint_t endpoint,
     uint64_t setup_data, uint8_t *data, size_t size,
     usbhc_iface_transfer_in_callback_t callback, void *arg)
@@ -250,5 +250,5 @@
  * @return Error code.
  */
-static int dev_write(ddf_fun_t *fun, usb_endpoint_t endpoint,
+static errno_t dev_write(ddf_fun_t *fun, usb_endpoint_t endpoint,
     uint64_t setup_data, const uint8_t *data, size_t size,
     usbhc_iface_transfer_out_callback_t callback, void *arg)
@@ -313,5 +313,5 @@
 };
 
-static int hcd_ddf_add_device(ddf_dev_t *parent, usb_dev_t *hub_dev,
+static errno_t hcd_ddf_add_device(ddf_dev_t *parent, usb_dev_t *hub_dev,
     unsigned port, usb_address_t address, usb_speed_t speed, const char *name,
     const match_id_list_t *mids)
@@ -351,5 +351,5 @@
 	}
 
-	int ret = ddf_fun_bind(fun);
+	errno_t ret = ddf_fun_bind(fun);
 	if (ret != EOK) {
 		ddf_fun_destroy(fun);
@@ -389,5 +389,5 @@
 
 /* This is a copy of lib/usbdev/src/recognise.c */
-static int create_match_ids(match_id_list_t *l,
+static errno_t create_match_ids(match_id_list_t *l,
     usb_standard_device_descriptor_t *d)
 {
@@ -418,5 +418,5 @@
 }
 
-static int hcd_ddf_remove_device(ddf_dev_t *device, usb_dev_t *hub,
+static errno_t hcd_ddf_remove_device(ddf_dev_t *device, usb_dev_t *hub,
     unsigned port)
 {
@@ -443,5 +443,5 @@
 		list_remove(&victim->link);
 		fibril_mutex_unlock(&hub->guard);
-		const int ret = ddf_fun_unbind(victim->fun);
+		const errno_t ret = ddf_fun_unbind(victim->fun);
 		if (ret == EOK) {
 			usb_address_t address = victim->address;
@@ -458,5 +458,5 @@
 }
 
-static int hcd_ddf_new_device(ddf_dev_t *device, usb_dev_t *hub, unsigned port)
+static errno_t hcd_ddf_new_device(ddf_dev_t *device, usb_dev_t *hub, unsigned port)
 {
 	assert(device);
@@ -468,5 +468,5 @@
 
 	/* This checks whether the default address is reserved and gets speed */
-	int ret = usb_bus_get_speed(&hcd->bus, USB_ADDRESS_DEFAULT, &speed);
+	errno_t ret = usb_bus_get_speed(&hcd->bus, USB_ADDRESS_DEFAULT, &speed);
 	if (ret != EOK) {
 		usb_log_error("Failed to verify speed: %s.", str_error(ret));
@@ -621,5 +621,5 @@
  * @return Error code
  */
-int hcd_ddf_setup_root_hub(ddf_dev_t *device)
+errno_t hcd_ddf_setup_root_hub(ddf_dev_t *device)
 {
 	assert(device);
@@ -628,5 +628,5 @@
 
 	hcd_reserve_default_address(hcd, hcd->bus.max_speed);
-	const int ret = hcd_ddf_new_device(device, NULL, 0);
+	const errno_t ret = hcd_ddf_new_device(device, NULL, 0);
 	hcd_release_default_address(hcd);
 	return ret;
@@ -643,5 +643,5 @@
  * This function does all the ddf work for hc driver.
  */
-int hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed,
+errno_t hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed,
     size_t bw, bw_count_func_t bw_count)
 {
@@ -656,5 +656,5 @@
 	hcd_init(&instance->hcd, max_speed, bw, bw_count);
 
-	int ret = ENOMEM;
+	errno_t ret = ENOMEM;
 	instance->ctl_fun = ddf_fun_create(device, fun_exposed, "ctl");
 	if (!instance->ctl_fun) {
@@ -691,5 +691,5 @@
 	hc_dev_t *hc = dev_to_hc_dev(device);
 	assert(hc);
-	const int ret = ddf_fun_unbind(hc->ctl_fun);
+	const errno_t ret = ddf_fun_unbind(hc->ctl_fun);
 	if (ret == EOK)
 		ddf_fun_destroy(hc->ctl_fun);
@@ -703,5 +703,5 @@
  * @return Error code.
  */
-int hcd_ddf_enable_interrupt(ddf_dev_t *device, int inum)
+errno_t hcd_ddf_enable_interrupt(ddf_dev_t *device, int inum)
 {
 	async_sess_t *parent_sess = ddf_dev_parent_sess_get(device);
@@ -713,5 +713,5 @@
 
 //TODO: Cache parent session in HCD
-int hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res)
+errno_t hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res)
 {
 	async_sess_t *parent_sess = ddf_dev_parent_sess_get(device);
@@ -720,5 +720,5 @@
 
 	hw_res_list_parsed_init(hw_res);
-	const int ret = hw_res_get_list_parsed(parent_sess, hw_res, 0);
+	const errno_t ret = hw_res_get_list_parsed(parent_sess, hw_res, 0);
 	if (ret != EOK)
 		hw_res_list_parsed_clean(hw_res);
@@ -751,8 +751,8 @@
  * @return Error code.
  */
-int hcd_ddf_setup_interrupts(ddf_dev_t *device,
+errno_t hcd_ddf_setup_interrupts(ddf_dev_t *device,
     const hw_res_list_parsed_t *hw_res,
     interrupt_handler_t handler,
-    int (*gen_irq_code)(irq_code_t *, const hw_res_list_parsed_t *, int *),
+    errno_t (*gen_irq_code)(irq_code_t *, const hw_res_list_parsed_t *, int *),
     cap_handle_t *handle)
 {
@@ -765,5 +765,5 @@
 
 	int irq;
-	int ret = gen_irq_code(&irq_code, hw_res, &irq);
+	errno_t ret = gen_irq_code(&irq_code, hw_res, &irq);
 	if (ret != EOK) {
 		usb_log_error("Failed to generate IRQ code: %s.\n",
@@ -809,5 +809,5 @@
 }
 
-static int interrupt_polling(void *arg)
+static errno_t interrupt_polling(void *arg)
 {
 	hcd_t *hcd = arg;
@@ -847,5 +847,5 @@
  *  - registers root hub
  */
-int hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver)
+errno_t hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver)
 {
 	assert(driver);
@@ -857,5 +857,5 @@
 	};
 
-	int ret = EOK;
+	errno_t ret = EOK;
 	const usb_speed_t speed = driver->hc_speed;
 	if (speed >= ARRAY_SIZE(bw) || bw[speed].bw == 0) {
@@ -884,5 +884,5 @@
 	    driver->irq_handler ? driver->irq_handler : ddf_hcd_gen_irq_handler;
 	int irq_cap;
-	int irq_ret = hcd_ddf_setup_interrupts(device, &hw_res,
+	errno_t irq_ret = hcd_ddf_setup_interrupts(device, &hw_res,
 	    irq_handler, driver->irq_code_gen, &irq_cap);
 	bool irqs_enabled = (irq_ret == EOK);
