Index: uspace/lib/usbdev/src/altiface.c
===================================================================
--- uspace/lib/usbdev/src/altiface.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/altiface.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -88,5 +88,5 @@
  * @return Error code.
  */
-int usb_alternate_interfaces_init(usb_alternate_interfaces_t *alternates,
+errno_t usb_alternate_interfaces_init(usb_alternate_interfaces_t *alternates,
     const uint8_t *config_descr, size_t config_descr_size, int interface_number)
 {
Index: uspace/lib/usbdev/src/devdrv.c
===================================================================
--- uspace/lib/usbdev/src/devdrv.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/devdrv.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -131,5 +131,5 @@
  * @return Error code.
  */
-int usb_device_select_interface(usb_device_t *usb_dev,
+errno_t usb_device_select_interface(usb_device_t *usb_dev,
     uint8_t alternate_setting, const usb_endpoint_description_t **endpoints)
 {
@@ -141,5 +141,5 @@
 
 	/* Change the interface itself. */
-	int rc = usb_request_set_interface(&usb_dev->ctrl_pipe,
+	errno_t rc = usb_request_set_interface(&usb_dev->ctrl_pipe,
 	    usb_dev->interface_no, alternate_setting);
 	if (rc != EOK) {
@@ -165,5 +165,5 @@
  * @return Error code.
  */
-static int usb_device_retrieve_descriptors(usb_device_t *usb_dev)
+static errno_t usb_device_retrieve_descriptors(usb_device_t *usb_dev)
 {
 	assert(usb_dev);
@@ -171,5 +171,5 @@
 
 	/* Get the device descriptor. */
-	int rc = usb_request_get_device_descriptor(&usb_dev->ctrl_pipe,
+	errno_t rc = usb_request_get_device_descriptor(&usb_dev->ctrl_pipe,
 	    &usb_dev->descriptors.device);
 	if (rc != EOK) {
@@ -217,5 +217,5 @@
  * @return Error code.
  */
-int usb_device_create_pipes(usb_device_t *usb_dev,
+errno_t usb_device_create_pipes(usb_device_t *usb_dev,
     const usb_endpoint_description_t **endpoints)
 {
@@ -245,5 +245,5 @@
 
 	/* Find the mapping from configuration descriptor. */
-	int rc = usb_pipe_initialize_from_configuration(pipes, pipe_count,
+	errno_t rc = usb_pipe_initialize_from_configuration(pipes, pipe_count,
 	    usb_dev->descriptors.full_config,
 	    usb_dev->descriptors.full_config_size,
@@ -393,5 +393,5 @@
  * @return Error code.
  */
-static int usb_device_init(usb_device_t *usb_dev, ddf_dev_t *ddf_dev,
+static errno_t usb_device_init(usb_device_t *usb_dev, ddf_dev_t *ddf_dev,
     const usb_endpoint_description_t **endpoints, const char **errstr_ptr,
     devman_handle_t handle, int interface_no)
@@ -420,5 +420,5 @@
 	/* This pipe was registered by the hub driver,
 	 * during device initialization. */
-	int rc = usb_pipe_initialize_default_control(
+	errno_t rc = usb_pipe_initialize_default_control(
 	    &usb_dev->ctrl_pipe, usb_dev->bus_session);
 	if (rc != EOK) {
@@ -457,5 +457,5 @@
 }
 
-static int usb_device_get_info(async_sess_t *sess, devman_handle_t *handle,
+static errno_t usb_device_get_info(async_sess_t *sess, devman_handle_t *handle,
 	int *iface_no)
 {
@@ -467,5 +467,5 @@
 		return EPARTY;
 	
-	int ret = usb_get_my_device_handle(exch, handle);
+	errno_t ret = usb_get_my_device_handle(exch, handle);
 	if (ret == EOK) {
 		ret = usb_get_my_interface(exch, iface_no);
@@ -480,5 +480,5 @@
 }
 
-int usb_device_create_ddf(ddf_dev_t *ddf_dev,
+errno_t usb_device_create_ddf(ddf_dev_t *ddf_dev,
     const usb_endpoint_description_t **desc, const char **err)
 {
@@ -492,5 +492,5 @@
 	if (sess == NULL)
 		return ENOMEM;
-	const int ret = usb_device_get_info(sess, &h, &iface_no);
+	const errno_t ret = usb_device_get_info(sess, &h, &iface_no);
 	if (ret != EOK)
 		return ret;
@@ -521,5 +521,5 @@
 
 	async_sess_t *sess = devman_device_connect(handle, IPC_FLAG_BLOCKING);
-	int ret = usb_device_get_info(sess, &h, &iface_no);
+	errno_t ret = usb_device_get_info(sess, &h, &iface_no);
 	if (sess)
 		async_hangup(sess);
Index: uspace/lib/usbdev/src/devpoll.c
===================================================================
--- uspace/lib/usbdev/src/devpoll.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/devpoll.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -77,5 +77,5 @@
  * @return Always EOK.
  */
-static int polling_fibril(void *arg)
+static errno_t polling_fibril(void *arg)
 {
 	assert(arg);
@@ -102,5 +102,5 @@
 	while (failed_attempts <= params->max_failures) {
 		size_t actual_size;
-		const int rc = usb_pipe_read(pipe, data->buffer,
+		const errno_t rc = usb_pipe_read(pipe, data->buffer,
 		    data->request_size, &actual_size);
 
@@ -206,5 +206,5 @@
  * @retval EOK New fibril polling the device was already started.
  */
-static int usb_device_auto_polling_internal(usb_device_t *dev,
+static errno_t usb_device_auto_polling_internal(usb_device_t *dev,
     usb_endpoint_mapping_t *epm, const usb_device_auto_polling_t *polling,
     size_t request_size)
@@ -275,5 +275,5 @@
  * @retval EOK New fibril polling the device was already started.
  */
-int usb_device_auto_polling(usb_device_t *usb_dev, usb_endpoint_t ep,
+errno_t usb_device_auto_polling(usb_device_t *usb_dev, usb_endpoint_t ep,
     const usb_device_auto_polling_t *polling, size_t req_size)
 {
@@ -301,5 +301,5 @@
  * @retval EOK New fibril polling the device was already started.
  */
-int usb_device_auto_poll(usb_device_t *dev, usb_endpoint_t ep,
+errno_t usb_device_auto_poll(usb_device_t *dev, usb_endpoint_t ep,
     usb_polling_callback_t callback, size_t request_size, int delay,
     usb_polling_terminted_callback_t terminated_callback, void *arg)
@@ -321,5 +321,5 @@
 }
 
-int usb_device_auto_polling_desc(usb_device_t *usb_dev,
+errno_t usb_device_auto_polling_desc(usb_device_t *usb_dev,
     const usb_endpoint_description_t *desc,
     const usb_device_auto_polling_t *polling, size_t req_size)
@@ -330,5 +330,5 @@
 }
 
-int usb_device_auto_poll_desc(usb_device_t * usb_dev,
+errno_t usb_device_auto_poll_desc(usb_device_t * usb_dev,
     const usb_endpoint_description_t *desc, usb_polling_callback_t callback,
     size_t req_size, int delay,
Index: uspace/lib/usbdev/src/driver.c
===================================================================
--- uspace/lib/usbdev/src/driver.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/driver.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -52,5 +52,5 @@
  * @return Error code.
  */
-static int generic_device_add(ddf_dev_t *gen_dev)
+static errno_t generic_device_add(ddf_dev_t *gen_dev)
 {
 	assert(driver);
@@ -60,5 +60,5 @@
 	/* Initialize generic USB driver data. */
 	const char *err_msg = NULL;
-	int rc = usb_device_create_ddf(gen_dev, driver->endpoints, &err_msg);
+	errno_t rc = usb_device_create_ddf(gen_dev, driver->endpoints, &err_msg);
 	if (rc != EOK) {
 		usb_log_error("USB device `%s' init failed (%s): %s.\n",
@@ -81,5 +81,5 @@
  * @return Error code.
  */
-static int generic_device_remove(ddf_dev_t *gen_dev)
+static errno_t generic_device_remove(ddf_dev_t *gen_dev)
 {
 	assert(driver);
@@ -89,5 +89,5 @@
 	/* Just tell the driver to stop whatever it is doing */
 	usb_device_t *usb_dev = ddf_dev_data_get(gen_dev);
-	const int ret = driver->ops->device_rem(usb_dev);
+	const errno_t ret = driver->ops->device_rem(usb_dev);
 	if (ret != EOK)
 		return ret;
@@ -103,5 +103,5 @@
  * @return Error code.
  */
-static int generic_device_gone(ddf_dev_t *gen_dev)
+static errno_t generic_device_gone(ddf_dev_t *gen_dev)
 {
 	assert(driver);
@@ -110,5 +110,5 @@
 		return ENOTSUP;
 	usb_device_t *usb_dev = ddf_dev_data_get(gen_dev);
-	const int ret = driver->ops->device_gone(usb_dev);
+	const errno_t ret = driver->ops->device_gone(usb_dev);
 	if (ret == EOK)
 		usb_device_destroy_ddf(gen_dev);
Index: uspace/lib/usbdev/src/pipes.c
===================================================================
--- uspace/lib/usbdev/src/pipes.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/pipes.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -74,5 +74,5 @@
  * @return Error code.
  */
-int usb_pipe_control_read(usb_pipe_t *pipe,
+errno_t usb_pipe_control_read(usb_pipe_t *pipe,
     const void *setup_buffer, size_t setup_buffer_size,
     void *buffer, size_t buffer_size, size_t *transfered_size)
@@ -98,5 +98,5 @@
 	async_exch_t *exch = async_exchange_begin(pipe->bus_session);
 	size_t act_size = 0;
-	const int rc = usb_read(exch, pipe->endpoint_no, setup_packet, buffer,
+	const errno_t rc = usb_read(exch, pipe->endpoint_no, setup_packet, buffer,
 	    buffer_size, &act_size);
 	async_exchange_end(exch);
@@ -124,5 +124,5 @@
  * @return Error code.
  */
-int usb_pipe_control_write(usb_pipe_t *pipe,
+errno_t usb_pipe_control_write(usb_pipe_t *pipe,
     const void *setup_buffer, size_t setup_buffer_size,
     const void *buffer, size_t buffer_size)
@@ -151,5 +151,5 @@
 
 	async_exch_t *exch = async_exchange_begin(pipe->bus_session);
-	const int rc = usb_write(exch,
+	const errno_t rc = usb_write(exch,
 	    pipe->endpoint_no, setup_packet, buffer, buffer_size);
 	async_exchange_end(exch);
@@ -170,5 +170,5 @@
  * @return Error code.
  */
-int usb_pipe_read(usb_pipe_t *pipe,
+errno_t usb_pipe_read(usb_pipe_t *pipe,
     void *buffer, size_t size, size_t *size_transfered)
 {
@@ -198,5 +198,5 @@
 	async_exch_t *exch = async_exchange_begin(pipe->bus_session);
 	size_t act_size = 0;
-	const int rc =
+	const errno_t rc =
 	    usb_read(exch, pipe->endpoint_no, 0, buffer, size, &act_size);
 	async_exchange_end(exch);
@@ -216,5 +216,5 @@
  * @return Error code.
  */
-int usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size)
+errno_t usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size)
 {
 	assert(pipe);
@@ -238,5 +238,5 @@
 
 	async_exch_t *exch = async_exchange_begin(pipe->bus_session);
-	const int rc = usb_write(exch, pipe->endpoint_no, 0, buffer, size);
+	const errno_t rc = usb_write(exch, pipe->endpoint_no, 0, buffer, size);
 	async_exchange_end(exch);
 	return rc;
@@ -252,5 +252,5 @@
  * @return Error code.
  */
-int usb_pipe_initialize(usb_pipe_t *pipe, usb_endpoint_t endpoint_no,
+errno_t usb_pipe_initialize(usb_pipe_t *pipe, usb_endpoint_t endpoint_no,
     usb_transfer_type_t transfer_type, size_t max_packet_size,
     usb_direction_t direction, unsigned packets, usb_dev_session_t *bus_session)
@@ -274,10 +274,10 @@
  * @return Error code.
  */
-int usb_pipe_initialize_default_control(usb_pipe_t *pipe,
+errno_t usb_pipe_initialize_default_control(usb_pipe_t *pipe,
     usb_dev_session_t *bus_session)
 {
 	assert(pipe);
 
-	const int rc = usb_pipe_initialize(pipe, 0, USB_TRANSFER_CONTROL,
+	const errno_t rc = usb_pipe_initialize(pipe, 0, USB_TRANSFER_CONTROL,
 	    CTRL_PIPE_MIN_PACKET_SIZE, USB_DIRECTION_BOTH, 1, bus_session);
 
@@ -293,5 +293,5 @@
  * @return Error code.
  */
-int usb_pipe_register(usb_pipe_t *pipe, unsigned interval)
+errno_t usb_pipe_register(usb_pipe_t *pipe, unsigned interval)
 {
 	assert(pipe);
@@ -300,5 +300,5 @@
 	if (!exch)
 		return ENOMEM;
-	const int ret = usb_register_endpoint(exch, pipe->endpoint_no,
+	const errno_t ret = usb_register_endpoint(exch, pipe->endpoint_no,
 	    pipe->transfer_type, pipe->direction, pipe->max_packet_size,
 	    pipe->packets, interval);
@@ -312,5 +312,5 @@
  * @return Error code.
  */
-int usb_pipe_unregister(usb_pipe_t *pipe)
+errno_t usb_pipe_unregister(usb_pipe_t *pipe)
 {
 	assert(pipe);
@@ -319,5 +319,5 @@
 	if (!exch)
 		return ENOMEM;
-	const int ret = usb_unregister_endpoint(exch, pipe->endpoint_no,
+	const errno_t ret = usb_unregister_endpoint(exch, pipe->endpoint_no,
 	    pipe->direction);
 	async_exchange_end(exch);
Index: uspace/lib/usbdev/src/pipesinit.c
===================================================================
--- uspace/lib/usbdev/src/pipesinit.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/pipesinit.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -152,5 +152,5 @@
  * @return Error code.
  */
-static int process_endpoint(
+static errno_t process_endpoint(
     usb_endpoint_mapping_t *mapping, size_t mapping_count,
     usb_standard_interface_descriptor_t *interface,
@@ -194,5 +194,5 @@
 	}
 
-	int rc = usb_pipe_initialize(&ep_mapping->pipe,
+	errno_t rc = usb_pipe_initialize(&ep_mapping->pipe,
 	    ep_no, description.transfer_type,
 	    ED_MPS_PACKET_SIZE_GET(
@@ -221,5 +221,5 @@
  * @return Error code.
  */
-static int process_interface(
+static errno_t process_interface(
     usb_endpoint_mapping_t *mapping, size_t mapping_count,
     const usb_dp_parser_t *parser, const usb_dp_parser_data_t *parser_data,
@@ -281,5 +281,5 @@
  * @return Error code.
  */
-int usb_pipe_initialize_from_configuration(
+errno_t usb_pipe_initialize_from_configuration(
     usb_endpoint_mapping_t *mapping, size_t mapping_count,
     const uint8_t *config_descriptor, size_t config_descriptor_size,
@@ -338,5 +338,5 @@
  * @return Error code.
  */
-int usb_pipe_probe_default_control(usb_pipe_t *pipe)
+errno_t usb_pipe_probe_default_control(usb_pipe_t *pipe)
 {
 	assert(pipe);
@@ -351,5 +351,5 @@
 	uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE];
 	size_t transferred_size;
-	int rc;
+	errno_t rc;
 	for (size_t attempt_var = 0; attempt_var < 3; ++attempt_var) {
 		rc = usb_request_get_descriptor(pipe, USB_REQUEST_TYPE_STANDARD,
Index: uspace/lib/usbdev/src/recognise.c
===================================================================
--- uspace/lib/usbdev/src/recognise.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/recognise.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -60,5 +60,5 @@
  * @return Error code.
  */
-static int usb_add_match_id(match_id_list_t *matches, int score,
+static errno_t usb_add_match_id(match_id_list_t *matches, int score,
     const char *match_str)
 {
@@ -89,5 +89,5 @@
 		int __rc = asprintf(&str, format, ##__VA_ARGS__); \
 		if (__rc >= 0) { \
-			int __rc = usb_add_match_id((match_ids), (score), str); \
+			errno_t __rc = usb_add_match_id((match_ids), (score), str); \
 			if (__rc != EOK) { \
 				free(str); \
@@ -108,5 +108,5 @@
  * @retval ENOENT Device class is not "use interface".
  */
-int usb_device_create_match_ids_from_interface(
+errno_t usb_device_create_match_ids_from_interface(
     const usb_standard_device_descriptor_t *desc_device,
     const usb_standard_interface_descriptor_t *desc_interface,
@@ -220,5 +220,5 @@
  * @return Error code.
  */
-int usb_device_create_match_ids_from_device_descriptor(
+errno_t usb_device_create_match_ids_from_device_descriptor(
     const usb_standard_device_descriptor_t *device_descriptor,
     match_id_list_t *matches)
@@ -264,9 +264,9 @@
  * @return Error code.
  */
-int usb_device_create_match_ids(usb_pipe_t *ctrl_pipe,
+errno_t usb_device_create_match_ids(usb_pipe_t *ctrl_pipe,
     match_id_list_t *matches)
 {
 	assert(ctrl_pipe);
-	int rc;
+	errno_t rc;
 	/*
 	 * Retrieve device descriptor and add matches from it.
Index: uspace/lib/usbdev/src/request.c
===================================================================
--- uspace/lib/usbdev/src/request.c	(revision 1569a9b70f7219a7103788305e4baf473da24376)
+++ uspace/lib/usbdev/src/request.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -68,5 +68,5 @@
  *
  */
-int usb_control_request_set(usb_pipe_t *pipe,
+errno_t usb_control_request_set(usb_pipe_t *pipe,
     usb_request_type_t request_type, usb_request_recipient_t recipient,
     uint8_t request, uint16_t value, uint16_t index,
@@ -127,5 +127,5 @@
  *
  */
-int usb_control_request_get(usb_pipe_t *pipe,
+errno_t usb_control_request_get(usb_pipe_t *pipe,
     usb_request_type_t request_type, usb_request_recipient_t recipient,
     uint8_t request, uint16_t value, uint16_t index,
@@ -170,5 +170,5 @@
  * @return Error code.
  */
-int usb_request_get_status(usb_pipe_t *pipe,
+errno_t usb_request_get_status(usb_pipe_t *pipe,
     usb_request_recipient_t recipient, uint16_t index,
     uint16_t *status)
@@ -184,5 +184,5 @@
 	uint16_t status_usb_endianess;
 	size_t data_transfered_size;
-	int rc = usb_control_request_get(pipe, USB_REQUEST_TYPE_STANDARD,
+	errno_t rc = usb_control_request_get(pipe, USB_REQUEST_TYPE_STANDARD,
 	    recipient, USB_DEVREQ_GET_STATUS, 0, uint16_host2usb(index),
 	    &status_usb_endianess, 2, &data_transfered_size);
@@ -208,5 +208,5 @@
  * @return Error code.
  */
-int usb_request_clear_feature(usb_pipe_t *pipe,
+errno_t usb_request_clear_feature(usb_pipe_t *pipe,
     usb_request_type_t request_type, usb_request_recipient_t recipient,
     uint16_t feature_selector, uint16_t index)
@@ -232,5 +232,5 @@
  * @return Error code.
  */
-int usb_request_set_feature(usb_pipe_t *pipe,
+errno_t usb_request_set_feature(usb_pipe_t *pipe,
     usb_request_type_t request_type, usb_request_recipient_t recipient,
     uint16_t feature_selector, uint16_t index)
@@ -260,5 +260,5 @@
  * @return Error code.
  */
-int usb_request_get_descriptor(usb_pipe_t *pipe,
+errno_t usb_request_get_descriptor(usb_pipe_t *pipe,
     usb_request_type_t request_type, usb_request_recipient_t recipient,
     uint8_t descriptor_type, uint8_t descriptor_index,
@@ -298,5 +298,5 @@
  * @return
  */
-int usb_request_get_descriptor_alloc(usb_pipe_t * pipe,
+errno_t usb_request_get_descriptor_alloc(usb_pipe_t * pipe,
     usb_request_type_t request_type, usb_request_recipient_t recipient,
     uint8_t descriptor_type, uint8_t descriptor_index,
@@ -308,5 +308,5 @@
 	}
 
-	int rc;
+	errno_t rc;
 
 	/*
@@ -364,5 +364,5 @@
  * @return Error code.
  */
-int usb_request_get_device_descriptor(usb_pipe_t *pipe,
+errno_t usb_request_get_device_descriptor(usb_pipe_t *pipe,
     usb_standard_device_descriptor_t *descriptor)
 {
@@ -373,5 +373,5 @@
 	size_t actually_transferred = 0;
 	usb_standard_device_descriptor_t descriptor_tmp;
-	int rc = usb_request_get_descriptor(pipe,
+	errno_t rc = usb_request_get_descriptor(pipe,
 	    USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE,
 	    USB_DESCTYPE_DEVICE, 0, 0, &descriptor_tmp, sizeof(descriptor_tmp),
@@ -404,5 +404,5 @@
  * @return Error code.
  */
-int usb_request_get_bare_configuration_descriptor(usb_pipe_t *pipe,
+errno_t usb_request_get_bare_configuration_descriptor(usb_pipe_t *pipe,
     int index, usb_standard_configuration_descriptor_t *descriptor)
 {
@@ -417,5 +417,5 @@
 	size_t actually_transferred = 0;
 	usb_standard_configuration_descriptor_t descriptor_tmp;
-	const int rc = usb_request_get_descriptor(pipe,
+	const errno_t rc = usb_request_get_descriptor(pipe,
 	    USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE,
 	    USB_DESCTYPE_CONFIGURATION, index, 0,
@@ -448,5 +448,5 @@
  * @return Error code.
  */
-int usb_request_get_full_configuration_descriptor(usb_pipe_t *pipe,
+errno_t usb_request_get_full_configuration_descriptor(usb_pipe_t *pipe,
     int index, void *descriptor, size_t descriptor_size, size_t *actual_size)
 {
@@ -473,9 +473,9 @@
  * @return Error code.
  */
-int usb_request_get_full_configuration_descriptor_alloc(
+errno_t usb_request_get_full_configuration_descriptor_alloc(
     usb_pipe_t *pipe, int index,
     const void **descriptor_ptr, size_t *descriptor_size)
 {
-	int rc;
+	errno_t rc;
 
 	if (descriptor_ptr == NULL) {
@@ -539,5 +539,5 @@
  * @return Error code.
  */
-int usb_request_set_descriptor(usb_pipe_t *pipe,
+errno_t usb_request_set_descriptor(usb_pipe_t *pipe,
     usb_request_type_t request_type, usb_request_recipient_t recipient,
     uint8_t descriptor_type, uint8_t descriptor_index,
@@ -565,5 +565,5 @@
  * @return Error code.
  */
-int usb_request_get_configuration(usb_pipe_t *pipe,
+errno_t usb_request_get_configuration(usb_pipe_t *pipe,
     uint8_t *configuration_value)
 {
@@ -571,5 +571,5 @@
 	size_t actual_size;
 
-	const int rc = usb_control_request_get(pipe,
+	const errno_t rc = usb_control_request_get(pipe,
 	    USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE,
 	    USB_DEVREQ_GET_CONFIGURATION, 0, 0, &value, 1, &actual_size);
@@ -595,5 +595,5 @@
  * @return Error code.
  */
-int usb_request_set_configuration(usb_pipe_t *pipe,
+errno_t usb_request_set_configuration(usb_pipe_t *pipe,
     uint8_t configuration_value)
 {
@@ -614,5 +614,5 @@
  * @return Error code.
  */
-int usb_request_get_interface(usb_pipe_t *pipe,
+errno_t usb_request_get_interface(usb_pipe_t *pipe,
     uint8_t interface_index, uint8_t *alternate_setting)
 {
@@ -620,5 +620,5 @@
 	size_t actual_size;
 
-	const int rc = usb_control_request_get(pipe,
+	const errno_t rc = usb_control_request_get(pipe,
 	    USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_INTERFACE,
 	    USB_DEVREQ_GET_INTERFACE,
@@ -647,5 +647,5 @@
  * @return Error code.
  */
-int usb_request_set_interface(usb_pipe_t *pipe,
+errno_t usb_request_set_interface(usb_pipe_t *pipe,
     uint8_t interface_index, uint8_t alternate_setting)
 {
@@ -666,5 +666,5 @@
  * @return Error code.
  */
-int usb_request_get_supported_languages(usb_pipe_t *pipe,
+errno_t usb_request_get_supported_languages(usb_pipe_t *pipe,
     l18_win_locales_t **languages_ptr, size_t *languages_count)
 {
@@ -675,5 +675,5 @@
 	uint8_t *string_descriptor = NULL;
 	size_t string_descriptor_size = 0;
-	const int rc = usb_request_get_descriptor_alloc(pipe,
+	const errno_t rc = usb_request_get_descriptor_alloc(pipe,
 	    USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE,
 	    USB_DESCTYPE_STRING, 0, 0,
@@ -733,5 +733,5 @@
  * @return Error code.
  */
-int usb_request_get_string(usb_pipe_t *pipe,
+errno_t usb_request_get_string(usb_pipe_t *pipe,
     size_t index, l18_win_locales_t lang, char **string_ptr)
 {
@@ -751,5 +751,5 @@
 	}
 
-	int rc;
+	errno_t rc;
 
 	/* Prepare dynamically allocated variables. */
@@ -824,5 +824,5 @@
  * @return Error code.
  */
-int usb_request_clear_endpoint_halt(usb_pipe_t *pipe, uint16_t ep_index)
+errno_t usb_request_clear_endpoint_halt(usb_pipe_t *pipe, uint16_t ep_index)
 {
 	return usb_request_clear_feature(pipe,
@@ -838,5 +838,5 @@
  * @return Error code.
  */
-int usb_pipe_clear_halt(usb_pipe_t *ctrl_pipe, usb_pipe_t *target_pipe)
+errno_t usb_pipe_clear_halt(usb_pipe_t *ctrl_pipe, usb_pipe_t *target_pipe)
 {
 	if ((ctrl_pipe == NULL) || (target_pipe == NULL)) {
@@ -854,10 +854,10 @@
  * @return Error code.
  */
-int usb_request_get_endpoint_status(usb_pipe_t *ctrl_pipe, usb_pipe_t *pipe,
+errno_t usb_request_get_endpoint_status(usb_pipe_t *ctrl_pipe, usb_pipe_t *pipe,
     uint16_t *status)
 {
 	uint16_t status_tmp;
 	uint16_t pipe_index = (uint16_t) pipe->endpoint_no;
-	int rc = usb_request_get_status(ctrl_pipe,
+	errno_t rc = usb_request_get_status(ctrl_pipe,
 	    USB_REQUEST_RECIPIENT_ENDPOINT, uint16_host2usb(pipe_index),
 	    &status_tmp);
