Index: uspace/drv/audio/hdaudio/codec.c
===================================================================
--- uspace/drv/audio/hdaudio/codec.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/codec.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -46,5 +46,5 @@
 #include "stream.h"
 
-static int hda_ccmd(hda_codec_t *codec, int node, uint32_t vid, uint32_t payload,
+static errno_t hda_ccmd(hda_codec_t *codec, int node, uint32_t vid, uint32_t payload,
     uint32_t *resp)
 {
@@ -66,5 +66,5 @@
 		    (payload & 0xffff);
 	}
-	int rc = hda_cmd(codec->hda, verb, resp);
+	errno_t rc = hda_cmd(codec->hda, verb, resp);
 /*
 	if (resp != NULL) {
@@ -78,5 +78,5 @@
 }
 
-static int hda_get_parameter(hda_codec_t *codec, int node, hda_param_id_t param,
+static errno_t hda_get_parameter(hda_codec_t *codec, int node, hda_param_id_t param,
     uint32_t *resp)
 {
@@ -84,8 +84,8 @@
 }
 
-static int hda_get_subnc(hda_codec_t *codec, int node, int *startnode,
+static errno_t hda_get_subnc(hda_codec_t *codec, int node, int *startnode,
     int *nodecount)
 {
-	int rc;
+	errno_t rc;
 	uint32_t resp;
 
@@ -103,8 +103,8 @@
 
 /** Get Function Group Type */
-static int hda_get_fgrp_type(hda_codec_t *codec, int node, bool *unsol,
+static errno_t hda_get_fgrp_type(hda_codec_t *codec, int node, bool *unsol,
     hda_fgrp_type_t *type)
 {
-	int rc;
+	errno_t rc;
 	uint32_t resp;
 
@@ -119,8 +119,8 @@
 }
 
-static int hda_get_clist_len(hda_codec_t *codec, int node, bool *longform,
+static errno_t hda_get_clist_len(hda_codec_t *codec, int node, bool *longform,
     int *items)
 {
-	int rc;
+	errno_t rc;
 	uint32_t resp;
 
@@ -135,15 +135,15 @@
 }
 
-static int hda_get_clist_entry(hda_codec_t *codec, int node, int n, uint32_t *resp)
+static errno_t hda_get_clist_entry(hda_codec_t *codec, int node, int n, uint32_t *resp)
 {
 	return hda_ccmd(codec, node, hda_clist_entry_get, n, resp);
 }
 
-static int hda_get_eapd_btl_enable(hda_codec_t *codec, int node, uint32_t *resp)
+static errno_t hda_get_eapd_btl_enable(hda_codec_t *codec, int node, uint32_t *resp)
 {
 	return hda_ccmd(codec, node, hda_eapd_btl_enable_get, 0, resp);
 }
 
-static int hda_set_eapd_btl_enable(hda_codec_t *codec, int node, uint8_t payload)
+static errno_t hda_set_eapd_btl_enable(hda_codec_t *codec, int node, uint8_t payload)
 {
 	return hda_ccmd(codec, node, hda_eapd_btl_enable_set, payload, NULL);
@@ -151,5 +151,5 @@
 
 /** Get Suppported PCM Size, Rates */
-static int hda_get_supp_rates(hda_codec_t *codec, int node, uint32_t *rates)
+static errno_t hda_get_supp_rates(hda_codec_t *codec, int node, uint32_t *rates)
 {
 	return hda_get_parameter(codec, node, hda_supp_rates, rates);
@@ -157,15 +157,15 @@
 
 /** Get Suppported Stream Formats */
-static int hda_get_supp_formats(hda_codec_t *codec, int node, uint32_t *fmts)
+static errno_t hda_get_supp_formats(hda_codec_t *codec, int node, uint32_t *fmts)
 {
 	return hda_get_parameter(codec, node, hda_supp_formats, fmts);
 }
 
-static int hda_set_converter_fmt(hda_codec_t *codec, int node, uint16_t fmt)
+static errno_t hda_set_converter_fmt(hda_codec_t *codec, int node, uint16_t fmt)
 {
 	return hda_ccmd(codec, node, hda_converter_fmt_set, fmt, NULL);
 }
 
-static int hda_set_converter_ctl(hda_codec_t *codec, int node, uint8_t stream,
+static errno_t hda_set_converter_ctl(hda_codec_t *codec, int node, uint8_t stream,
     uint8_t channel)
 {
@@ -176,12 +176,12 @@
 }
 
-static int hda_set_pin_ctl(hda_codec_t *codec, int node, uint8_t pctl)
+static errno_t hda_set_pin_ctl(hda_codec_t *codec, int node, uint8_t pctl)
 {
 	return hda_ccmd(codec, node, hda_pin_ctl_set, pctl, NULL);
 }
 
-static int hda_get_pin_ctl(hda_codec_t *codec, int node, uint8_t *pctl)
-{
-	int rc;
+static errno_t hda_get_pin_ctl(hda_codec_t *codec, int node, uint8_t *pctl)
+{
+	errno_t rc;
 	uint32_t resp;
 
@@ -195,8 +195,8 @@
 
 /** Get Audio Widget Capabilities */
-static int hda_get_aw_caps(hda_codec_t *codec, int node,
+static errno_t hda_get_aw_caps(hda_codec_t *codec, int node,
     hda_awidget_type_t *type, uint32_t *caps)
 {
-	int rc;
+	errno_t rc;
 	uint32_t resp;
 
@@ -212,5 +212,5 @@
 
 /** Get Pin Capabilities */
-static int hda_get_pin_caps(hda_codec_t *codec, int node, uint32_t *caps)
+static errno_t hda_get_pin_caps(hda_codec_t *codec, int node, uint32_t *caps)
 {
 	return hda_get_parameter(codec, node, hda_pin_caps, caps);
@@ -218,5 +218,5 @@
 
 /** Get Power State */
-static int hda_get_power_state(hda_codec_t *codec, int node, uint32_t *pstate)
+static errno_t hda_get_power_state(hda_codec_t *codec, int node, uint32_t *pstate)
 {
 	return hda_ccmd(codec, node, hda_power_state_get, 0, pstate);
@@ -224,10 +224,10 @@
 
 /** Get Configuration Default */
-static int hda_get_cfg_def(hda_codec_t *codec, int node, uint32_t *cfgdef)
+static errno_t hda_get_cfg_def(hda_codec_t *codec, int node, uint32_t *cfgdef)
 {
 	return hda_ccmd(codec, node, hda_cfg_def_get, 0, cfgdef);
 }
 
-static int hda_get_conn_sel(hda_codec_t *codec, int node, uint32_t *conn)
+static errno_t hda_get_conn_sel(hda_codec_t *codec, int node, uint32_t *conn)
 {
 	return hda_ccmd(codec, node, hda_conn_sel_get, 0, conn);
@@ -235,10 +235,10 @@
 
 /** Get Amplifier Gain / Mute  */
-static int hda_get_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload,
+static errno_t hda_get_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload,
     uint32_t *resp)
 {
 //	ddf_msg(LVL_NOTE, "hda_get_amp_gain_mute(codec, %d, %x)",
 //	    node, payload);
-	int rc = hda_ccmd(codec, node, hda_amp_gain_mute_get, payload, resp);
+	errno_t rc = hda_ccmd(codec, node, hda_amp_gain_mute_get, payload, resp);
 //	ddf_msg(LVL_NOTE, "hda_get_amp_gain_mute(codec, %d, %x, resp=%x)",
 //	    node, payload, *resp);
@@ -247,10 +247,10 @@
 
 /** Get GP I/O Count */
-static int hda_get_gpio_cnt(hda_codec_t *codec, int node, uint32_t *resp)
+static errno_t hda_get_gpio_cnt(hda_codec_t *codec, int node, uint32_t *resp)
 {
 	return hda_get_parameter(codec, node, hda_gpio_cnt, resp);
 }
 
-static int hda_set_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload)
+static errno_t hda_set_amp_gain_mute(hda_codec_t *codec, int node, uint16_t payload)
 {
 //	ddf_msg(LVL_NOTE, "hda_set_amp_gain_mute(codec, %d, %x)",
@@ -259,10 +259,10 @@
 }
 
-static int hda_set_out_amp_max(hda_codec_t *codec, uint8_t aw)
+static errno_t hda_set_out_amp_max(hda_codec_t *codec, uint8_t aw)
 {
 	uint32_t ampcaps;
 	uint32_t gmleft, gmright;
 	uint32_t offset;
-	int rc;
+	errno_t rc;
 
 	rc = hda_get_parameter(codec, aw,
@@ -294,5 +294,5 @@
 }
 
-static int hda_set_in_amp_max(hda_codec_t *codec, uint8_t aw)
+static errno_t hda_set_in_amp_max(hda_codec_t *codec, uint8_t aw)
 {
 	uint32_t ampcaps;
@@ -300,5 +300,5 @@
 	uint32_t offset;
 	int i;
-	int rc;
+	errno_t rc;
 
 	rc = hda_get_parameter(codec, aw,
@@ -332,7 +332,7 @@
 }
 
-static int hda_clist_dump(hda_codec_t *codec, uint8_t aw)
-{
-	int rc;
+static errno_t hda_clist_dump(hda_codec_t *codec, uint8_t aw)
+{
+	errno_t rc;
 	bool longform;
 	int len;
@@ -394,7 +394,7 @@
 }
 
-static int hda_pin_init(hda_codec_t *codec, uint8_t aw)
-{
-	int rc;
+static errno_t hda_pin_init(hda_codec_t *codec, uint8_t aw)
+{
+	errno_t rc;
 	uint32_t cfgdef;
 	uint32_t pcaps;
@@ -471,7 +471,7 @@
 
 /** Init power-control in wiget capable of doing so. */
-static int hda_power_ctl_init(hda_codec_t *codec, uint8_t aw)
-{
-	int rc;
+static errno_t hda_power_ctl_init(hda_codec_t *codec, uint8_t aw)
+{
+	errno_t rc;
 	uint32_t pwrstate;
 
@@ -491,5 +491,5 @@
 {
 	hda_codec_t *codec;
-	int rc;
+	errno_t rc;
 	int sfg, nfg;
 	int saw, naw;
@@ -639,7 +639,7 @@
 }
 
-int hda_out_converter_setup(hda_codec_t *codec, hda_stream_t *stream)
-{
-	int rc;
+errno_t hda_out_converter_setup(hda_codec_t *codec, hda_stream_t *stream)
+{
+	errno_t rc;
 	int out_aw;
 	int i;
@@ -666,7 +666,7 @@
 }
 
-int hda_in_converter_setup(hda_codec_t *codec, hda_stream_t *stream)
-{
-	int rc;
+errno_t hda_in_converter_setup(hda_codec_t *codec, hda_stream_t *stream)
+{
+	errno_t rc;
 
 	/* Configure converter */
Index: uspace/drv/audio/hdaudio/codec.h
===================================================================
--- uspace/drv/audio/hdaudio/codec.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/codec.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -52,6 +52,6 @@
 extern hda_codec_t *hda_codec_init(hda_t *, uint8_t);
 extern void hda_codec_fini(hda_codec_t *);
-extern int hda_out_converter_setup(hda_codec_t *, hda_stream_t *);
-extern int hda_in_converter_setup(hda_codec_t *, hda_stream_t *);
+extern errno_t hda_out_converter_setup(hda_codec_t *, hda_stream_t *);
+extern errno_t hda_in_converter_setup(hda_codec_t *, hda_stream_t *);
 
 #endif
Index: uspace/drv/audio/hdaudio/hdactl.c
===================================================================
--- uspace/drv/audio/hdaudio/hdactl.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/hdactl.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -64,5 +64,5 @@
  * to read as 0.
  */
-static int hda_ctl_reg16_set_reset(uint16_t *reg, uint16_t mask)
+static errno_t hda_ctl_reg16_set_reset(uint16_t *reg, uint16_t mask)
 {
 	uint16_t val;
@@ -116,5 +116,5 @@
  *
  */
-static int hda_rb_size_select(uint8_t sizecap, uint8_t *selsz)
+static errno_t hda_rb_size_select(uint8_t sizecap, uint8_t *selsz)
 {
 	int i;
@@ -146,5 +146,5 @@
 
 /** Initialize the CORB */
-static int hda_corb_init(hda_t *hda)
+static errno_t hda_corb_init(hda_t *hda)
 {
 	uint8_t ctl;
@@ -152,5 +152,5 @@
 	uint8_t sizecap;
 	uint8_t selsz;
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_NOTE, "hda_corb_init()");
@@ -237,5 +237,5 @@
 
 /** Initialize the RIRB */
-static int hda_rirb_init(hda_t *hda)
+static errno_t hda_rirb_init(hda_t *hda)
 {
 	uint8_t ctl;
@@ -243,5 +243,5 @@
 	uint8_t sizecap;
 	uint8_t selsz;
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_NOTE, "hda_rirb_init()");
@@ -372,5 +372,5 @@
 
 /** Write to CORB */
-static int hda_corb_write(hda_t *hda, uint32_t *data, size_t count)
+static errno_t hda_corb_write(hda_t *hda, uint32_t *data, size_t count)
 {
 	size_t avail;
@@ -414,5 +414,5 @@
 }
 
-static int hda_rirb_read(hda_t *hda, hda_rirb_entry_t *data)
+static errno_t hda_rirb_read(hda_t *hda, hda_rirb_entry_t *data)
 {
 	size_t wp;
@@ -436,5 +436,5 @@
 }
 
-static int hda_solrb_read(hda_t *hda, hda_rirb_entry_t *data, size_t count)
+static errno_t hda_solrb_read(hda_t *hda, hda_rirb_entry_t *data, size_t count)
 {
 	hda_rirb_entry_t resp;
@@ -490,5 +490,5 @@
 	uint32_t intctl;
 	int cnt;
-	int rc;
+	errno_t rc;
 
 	ctl = calloc(1, sizeof(hda_ctl_t));
@@ -615,7 +615,7 @@
 }
 
-int hda_cmd(hda_t *hda, uint32_t verb, uint32_t *resp)
-{
-	int rc;
+errno_t hda_cmd(hda_t *hda, uint32_t verb, uint32_t *resp)
+{
+	errno_t rc;
 	hda_rirb_entry_t rentry;
 
@@ -639,5 +639,5 @@
 {
 	hda_rirb_entry_t resp;
-	int rc;
+	errno_t rc;
 
 	while (true) {
Index: uspace/drv/audio/hdaudio/hdactl.h
===================================================================
--- uspace/drv/audio/hdaudio/hdactl.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/hdactl.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -78,5 +78,5 @@
 extern void hda_ctl_fini(hda_ctl_t *);
 extern void hda_ctl_interrupt(hda_ctl_t *);
-extern int hda_cmd(hda_t *, uint32_t, uint32_t *);
+extern errno_t hda_cmd(hda_t *, uint32_t, uint32_t *);
 extern void hda_ctl_dump_info(hda_ctl_t *);
 
Index: uspace/drv/audio/hdaudio/hdaudio.c
===================================================================
--- uspace/drv/audio/hdaudio/hdaudio.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/hdaudio.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -52,9 +52,9 @@
 #define NAME "hdaudio"
 
-static int hda_dev_add(ddf_dev_t *dev);
-static int hda_dev_remove(ddf_dev_t *dev);
-static int hda_dev_gone(ddf_dev_t *dev);
-static int hda_fun_online(ddf_fun_t *fun);
-static int hda_fun_offline(ddf_fun_t *fun);
+static errno_t hda_dev_add(ddf_dev_t *dev);
+static errno_t hda_dev_remove(ddf_dev_t *dev);
+static errno_t hda_dev_gone(ddf_dev_t *dev);
+static errno_t hda_fun_online(ddf_fun_t *fun);
+static errno_t hda_fun_offline(ddf_fun_t *fun);
 
 static void hdaudio_interrupt(ipc_call_t *, ddf_dev_t *);
@@ -148,5 +148,5 @@
 };
 
-static int hda_dev_add(ddf_dev_t *dev)
+static errno_t hda_dev_add(ddf_dev_t *dev)
 {
 	ddf_fun_t *fun_pcm = NULL;
@@ -160,5 +160,5 @@
 	int i;
 	void *regs = NULL;
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_NOTE, "hda_dev_add()");
@@ -318,8 +318,8 @@
 }
 
-static int hda_dev_remove(ddf_dev_t *dev)
+static errno_t hda_dev_remove(ddf_dev_t *dev)
 {
 	hda_t *hda = (hda_t *)ddf_dev_data_get(dev);
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_DEBUG, "hda_dev_remove(%p)", dev);
@@ -340,8 +340,8 @@
 }
 
-static int hda_dev_gone(ddf_dev_t *dev)
+static errno_t hda_dev_gone(ddf_dev_t *dev)
 {
 	hda_t *hda = (hda_t *)ddf_dev_data_get(dev);
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_DEBUG, "hda_dev_remove(%p)", dev);
@@ -356,5 +356,5 @@
 }
 
-static int hda_fun_online(ddf_fun_t *fun)
+static errno_t hda_fun_online(ddf_fun_t *fun)
 {
 	ddf_msg(LVL_DEBUG, "hda_fun_online()");
@@ -362,5 +362,5 @@
 }
 
-static int hda_fun_offline(ddf_fun_t *fun)
+static errno_t hda_fun_offline(ddf_fun_t *fun)
 {
 	ddf_msg(LVL_DEBUG, "hda_fun_offline()");
Index: uspace/drv/audio/hdaudio/pcm_iface.c
===================================================================
--- uspace/drv/audio/hdaudio/pcm_iface.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/pcm_iface.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -47,19 +47,19 @@
 #include "stream.h"
 
-static int hda_get_info_str(ddf_fun_t *, const char **);
+static errno_t hda_get_info_str(ddf_fun_t *, const char **);
 static unsigned hda_query_cap(ddf_fun_t *, audio_cap_t);
-static int hda_test_format(ddf_fun_t *, unsigned *, unsigned *,
+static errno_t hda_test_format(ddf_fun_t *, unsigned *, unsigned *,
     pcm_sample_format_t *);
-static int hda_get_buffer(ddf_fun_t *, void **, size_t *);
-static int hda_get_buffer_position(ddf_fun_t *, size_t *);
-static int hda_set_event_session(ddf_fun_t *, async_sess_t *);
+static errno_t hda_get_buffer(ddf_fun_t *, void **, size_t *);
+static errno_t hda_get_buffer_position(ddf_fun_t *, size_t *);
+static errno_t hda_set_event_session(ddf_fun_t *, async_sess_t *);
 static async_sess_t *hda_get_event_session(ddf_fun_t *);
-static int hda_release_buffer(ddf_fun_t *);
-static int hda_start_playback(ddf_fun_t *, unsigned, unsigned, unsigned,
+static errno_t hda_release_buffer(ddf_fun_t *);
+static errno_t hda_start_playback(ddf_fun_t *, unsigned, unsigned, unsigned,
     pcm_sample_format_t);
-static int hda_stop_playback(ddf_fun_t *, bool);
-static int hda_start_capture(ddf_fun_t *, unsigned, unsigned, unsigned,
+static errno_t hda_stop_playback(ddf_fun_t *, bool);
+static errno_t hda_start_capture(ddf_fun_t *, unsigned, unsigned, unsigned,
     pcm_sample_format_t);
-static int hda_stop_capture(ddf_fun_t *, bool);
+static errno_t hda_stop_capture(ddf_fun_t *, bool);
 
 audio_pcm_iface_t hda_pcm_iface = {
@@ -90,5 +90,5 @@
 }
 
-static int hda_get_info_str(ddf_fun_t *fun, const char **name)
+static errno_t hda_get_info_str(ddf_fun_t *fun, const char **name)
 {
 	ddf_msg(LVL_NOTE, "hda_get_info_str()");
@@ -124,8 +124,8 @@
 }
 
-static int hda_test_format(ddf_fun_t *fun, unsigned *channels,
+static errno_t hda_test_format(ddf_fun_t *fun, unsigned *channels,
     unsigned *rate, pcm_sample_format_t *format)
 {
-	int rc = EOK;
+	errno_t rc = EOK;
 
 	ddf_msg(LVL_NOTE, "hda_test_format(%u, %u, %d)\n",
@@ -150,8 +150,8 @@
 }
 
-static int hda_get_buffer(ddf_fun_t *fun, void **buffer, size_t *size)
-{
-	hda_t *hda = fun_to_hda(fun);
-	int rc;
+static errno_t hda_get_buffer(ddf_fun_t *fun, void **buffer, size_t *size)
+{
+	hda_t *hda = fun_to_hda(fun);
+	errno_t rc;
 
 	hda_lock(hda);
@@ -183,5 +183,5 @@
 }
 
-static int hda_get_buffer_position(ddf_fun_t *fun, size_t *pos)
+static errno_t hda_get_buffer_position(ddf_fun_t *fun, size_t *pos)
 {
 	ddf_msg(LVL_NOTE, "hda_get_buffer_position()");
@@ -189,5 +189,5 @@
 }
 
-static int hda_set_event_session(ddf_fun_t *fun, async_sess_t *sess)
+static errno_t hda_set_event_session(ddf_fun_t *fun, async_sess_t *sess)
 {
 	hda_t *hda = fun_to_hda(fun);
@@ -215,5 +215,5 @@
 }
 
-static int hda_release_buffer(ddf_fun_t *fun)
+static errno_t hda_release_buffer(ddf_fun_t *fun)
 {
 	hda_t *hda = fun_to_hda(fun);
@@ -234,9 +234,9 @@
 }
 
-static int hda_start_playback(ddf_fun_t *fun, unsigned frames,
+static errno_t hda_start_playback(ddf_fun_t *fun, unsigned frames,
     unsigned channels, unsigned rate, pcm_sample_format_t format)
 {
 	hda_t *hda = fun_to_hda(fun);
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_NOTE, "hda_start_playback()");
@@ -275,5 +275,5 @@
 }
 
-static int hda_stop_playback(ddf_fun_t *fun, bool immediate)
+static errno_t hda_stop_playback(ddf_fun_t *fun, bool immediate)
 {
 	hda_t *hda = fun_to_hda(fun);
@@ -293,9 +293,9 @@
 }
 
-static int hda_start_capture(ddf_fun_t *fun, unsigned frames, unsigned channels,
+static errno_t hda_start_capture(ddf_fun_t *fun, unsigned frames, unsigned channels,
     unsigned rate, pcm_sample_format_t format)
 {
 	hda_t *hda = fun_to_hda(fun);
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_NOTE, "hda_start_capture()");
@@ -334,5 +334,5 @@
 }
 
-static int hda_stop_capture(ddf_fun_t *fun, bool immediate)
+static errno_t hda_stop_capture(ddf_fun_t *fun, bool immediate)
 {
 	hda_t *hda = fun_to_hda(fun);
Index: uspace/drv/audio/hdaudio/stream.c
===================================================================
--- uspace/drv/audio/hdaudio/stream.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/stream.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -49,5 +49,5 @@
 #include "stream.h"
 
-int hda_stream_buffers_alloc(hda_t *hda, hda_stream_buffers_t **rbufs)
+errno_t hda_stream_buffers_alloc(hda_t *hda, hda_stream_buffers_t **rbufs)
 {
 	void *bdl;
@@ -57,5 +57,5 @@
 	size_t i;
 //	size_t j, k;
-	int rc;
+	errno_t rc;
 
 	bufs = calloc(1, sizeof(hda_stream_buffers_t));
Index: uspace/drv/audio/hdaudio/stream.h
===================================================================
--- uspace/drv/audio/hdaudio/stream.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/hdaudio/stream.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -77,5 +77,5 @@
 } hda_stream_t;
 
-extern int hda_stream_buffers_alloc(hda_t *, hda_stream_buffers_t **);
+extern errno_t hda_stream_buffers_alloc(hda_t *, hda_stream_buffers_t **);
 extern void hda_stream_buffers_free(hda_stream_buffers_t *);
 extern hda_stream_t *hda_stream_create(hda_t *, hda_stream_dir_t,
Index: uspace/drv/audio/sb16/dsp.c
===================================================================
--- uspace/drv/audio/sb16/dsp.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/dsp.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -89,5 +89,5 @@
 }
 
-static inline int dsp_read(sb_dsp_t *dsp, uint8_t *data)
+static inline errno_t dsp_read(sb_dsp_t *dsp, uint8_t *data)
 {
 	assert(data);
@@ -106,5 +106,5 @@
 }
 
-static inline int dsp_write(sb_dsp_t *dsp, uint8_t data)
+static inline errno_t dsp_write(sb_dsp_t *dsp, uint8_t data)
 {
 	assert(dsp);
@@ -159,5 +159,5 @@
 }
 
-static inline int setup_dma(sb_dsp_t *dsp, uintptr_t pa, size_t size)
+static inline errno_t setup_dma(sb_dsp_t *dsp, uintptr_t pa, size_t size)
 {
 	async_sess_t *sess = ddf_dev_parent_sess_get(dsp->sb_dev);
@@ -168,5 +168,5 @@
 }
 
-static inline int setup_buffer(sb_dsp_t *dsp, size_t size)
+static inline errno_t setup_buffer(sb_dsp_t *dsp, size_t size)
 {
 	assert(dsp);
@@ -178,5 +178,5 @@
 	void *buffer = AS_AREA_ANY;
 	
-	int ret = dmamem_map_anonymous(size, DMAMEM_16MiB | 0x0000ffff,
+	errno_t ret = dmamem_map_anonymous(size, DMAMEM_16MiB | 0x0000ffff,
 	    AS_AREA_WRITE | AS_AREA_READ, 0, &pa, &buffer);
 	if (ret != EOK) {
@@ -202,5 +202,5 @@
 }
 
-int sb_dsp_init(sb_dsp_t *dsp, sb16_regs_t *regs, ddf_dev_t *dev,
+errno_t sb_dsp_init(sb_dsp_t *dsp, sb16_regs_t *regs, ddf_dev_t *dev,
     int dma8, int dma16)
 {
@@ -215,5 +215,5 @@
 	dsp_reset(dsp);
 	uint8_t response;
-	const int ret = dsp_read(dsp, &response);
+	const errno_t ret = dsp_read(dsp, &response);
 	if (ret != EOK) {
 		ddf_log_error("Failed to read DSP reset response value.");
@@ -294,5 +294,5 @@
 }
 
-int sb_dsp_get_buffer_position(sb_dsp_t *dsp, size_t *pos)
+errno_t sb_dsp_get_buffer_position(sb_dsp_t *dsp, size_t *pos)
 {
 	if (dsp->state == DSP_NO_BUFFER)
@@ -304,5 +304,5 @@
 	// TODO: Assumes DMA 16
 	size_t remain;
-	int rc = hw_res_dma_channel_remain(sess, dsp->dma16_channel, &remain);
+	errno_t rc = hw_res_dma_channel_remain(sess, dsp->dma16_channel, &remain);
 	if (rc == EOK) {
 		*pos = dsp->buffer.size - remain;
@@ -311,8 +311,8 @@
 }
 
-int sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
+errno_t sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
   pcm_sample_format_t *format)
 {
-	int ret = EOK;
+	errno_t ret = EOK;
 	if (*channels == 0 || *channels > 2) {
 		*channels = 2;
@@ -336,5 +336,5 @@
 }
 
-int sb_dsp_set_event_session(sb_dsp_t *dsp, async_sess_t *session)
+errno_t sb_dsp_set_event_session(sb_dsp_t *dsp, async_sess_t *session)
 {
 	assert(dsp);
@@ -353,5 +353,5 @@
 }
 
-int sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size)
+errno_t sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size)
 {
 	assert(dsp);
@@ -364,5 +364,5 @@
 	assert(dsp->buffer.data == NULL);
 
-	const int ret = setup_buffer(dsp, *size);
+	const errno_t ret = setup_buffer(dsp, *size);
 	if (ret == EOK) {
 		ddf_log_debug("Providing buffer: %p, %zu B.",
@@ -378,5 +378,5 @@
 }
 
-int sb_dsp_release_buffer(sb_dsp_t *dsp)
+errno_t sb_dsp_release_buffer(sb_dsp_t *dsp)
 {
 	assert(dsp);
@@ -392,5 +392,5 @@
 }
 
-int sb_dsp_start_playback(sb_dsp_t *dsp, unsigned frames,
+errno_t sb_dsp_start_playback(sb_dsp_t *dsp, unsigned frames,
     unsigned channels, unsigned sampling_rate, pcm_sample_format_t format)
 {
@@ -441,5 +441,5 @@
 }
 
-int sb_dsp_stop_playback(sb_dsp_t *dsp, bool immediate)
+errno_t sb_dsp_stop_playback(sb_dsp_t *dsp, bool immediate)
 {
 	assert(dsp);
@@ -471,5 +471,5 @@
 }
 
-int sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
+errno_t sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
     unsigned channels, unsigned sampling_rate, pcm_sample_format_t format)
 {
@@ -517,5 +517,5 @@
 }
 
-int sb_dsp_stop_capture(sb_dsp_t *dsp, bool immediate)
+errno_t sb_dsp_stop_capture(sb_dsp_t *dsp, bool immediate)
 {
 	assert(dsp);
Index: uspace/drv/audio/sb16/dsp.h
===================================================================
--- uspace/drv/audio/sb16/dsp.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/dsp.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -76,21 +76,21 @@
 } sb_dsp_t;
 
-int sb_dsp_init(sb_dsp_t *dsp, sb16_regs_t *regs, ddf_dev_t *dev,
+errno_t sb_dsp_init(sb_dsp_t *dsp, sb16_regs_t *regs, ddf_dev_t *dev,
     int dma8, int dma16);
 void sb_dsp_interrupt(sb_dsp_t *dsp);
 unsigned sb_dsp_query_cap(sb_dsp_t *dsp, audio_cap_t cap);
-int sb_dsp_get_buffer_position(sb_dsp_t *dsp, size_t *size);
-int sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
+errno_t sb_dsp_get_buffer_position(sb_dsp_t *dsp, size_t *size);
+errno_t sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
   pcm_sample_format_t *format);
-int sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size);
-int sb_dsp_set_event_session(sb_dsp_t *dsp, async_sess_t *session);
+errno_t sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size);
+errno_t sb_dsp_set_event_session(sb_dsp_t *dsp, async_sess_t *session);
 async_sess_t * sb_dsp_get_event_session(sb_dsp_t *dsp);
-int sb_dsp_release_buffer(sb_dsp_t *dsp);
-int sb_dsp_start_playback(sb_dsp_t *dsp, unsigned frames,
+errno_t sb_dsp_release_buffer(sb_dsp_t *dsp);
+errno_t sb_dsp_start_playback(sb_dsp_t *dsp, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format);
-int sb_dsp_stop_playback(sb_dsp_t *dsp, bool immediate);
-int sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
+errno_t sb_dsp_stop_playback(sb_dsp_t *dsp, bool immediate);
+errno_t sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format);
-int sb_dsp_stop_capture(sb_dsp_t *dsp, bool immediate);
+errno_t sb_dsp_stop_capture(sb_dsp_t *dsp, bool immediate);
 
 #endif
Index: uspace/drv/audio/sb16/main.c
===================================================================
--- uspace/drv/audio/sb16/main.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/main.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -47,8 +47,8 @@
 #define NAME "sb16"
 
-static int sb_add_device(ddf_dev_t *device);
-static int sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
+static errno_t sb_add_device(ddf_dev_t *device);
+static errno_t sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
     addr_range_t **pp_mpu_regs, int *irq, int *dma8, int *dma16);
-static int sb_enable_interrupt(ddf_dev_t *device, int irq);
+static errno_t sb_enable_interrupt(ddf_dev_t *device, int irq);
 
 static driver_ops_t sb_driver_ops = {
@@ -87,5 +87,5 @@
  * @return Error code.
  */
-static int sb_add_device(ddf_dev_t *device)
+static errno_t sb_add_device(ddf_dev_t *device)
 {
 	bool handler_regd = false;
@@ -96,5 +96,5 @@
 
 	sb16_t *soft_state = ddf_dev_data_alloc(device, sizeof(sb16_t));
-	int rc = soft_state ? EOK : ENOMEM;
+	errno_t rc = soft_state ? EOK : ENOMEM;
 	if (rc != EOK) {
 		ddf_log_error("Failed to allocate sb16 structure.");
@@ -173,5 +173,5 @@
 }
 
-static int sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
+static errno_t sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
     addr_range_t **pp_mpu_regs, int *irq, int *dma8, int *dma16)
 {
@@ -184,5 +184,5 @@
 	hw_res_list_parsed_t hw_res;
 	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) {
 		return ret;
@@ -241,5 +241,5 @@
 }
 
-static int sb_enable_interrupt(ddf_dev_t *device, int irq)
+static errno_t sb_enable_interrupt(ddf_dev_t *device, int irq)
 {
 	async_sess_t *parent_sess = ddf_dev_parent_sess_get(device);
Index: uspace/drv/audio/sb16/mixer.c
===================================================================
--- uspace/drv/audio/sb16/mixer.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/mixer.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -123,5 +123,5 @@
 }
 
-int sb_mixer_init(sb_mixer_t *mixer, sb16_regs_t *regs, sb_mixer_type_t type)
+errno_t sb_mixer_init(sb_mixer_t *mixer, sb16_regs_t *regs, sb_mixer_type_t type)
 {
 	assert(mixer);
@@ -149,5 +149,5 @@
 }
 
-int sb_mixer_get_control_item_info(const sb_mixer_t *mixer, unsigned item,
+errno_t sb_mixer_get_control_item_info(const sb_mixer_t *mixer, unsigned item,
     const char** name, unsigned *levels)
 {
@@ -171,5 +171,5 @@
  * @return Error code.
  */
-int sb_mixer_get_control_item_value(const sb_mixer_t *mixer, unsigned item,
+errno_t sb_mixer_get_control_item_value(const sb_mixer_t *mixer, unsigned item,
     unsigned *value)
 {
@@ -194,5 +194,5 @@
  * @return Error code.
  */
-int sb_mixer_set_control_item_value(const sb_mixer_t *mixer, unsigned item,
+errno_t sb_mixer_set_control_item_value(const sb_mixer_t *mixer, unsigned item,
     unsigned value)
 {
Index: uspace/drv/audio/sb16/mixer.h
===================================================================
--- uspace/drv/audio/sb16/mixer.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/mixer.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -51,11 +51,11 @@
 
 const char * sb_mixer_type_str(sb_mixer_type_t type);
-int sb_mixer_init(sb_mixer_t *mixer, sb16_regs_t *regs, sb_mixer_type_t type);
+errno_t sb_mixer_init(sb_mixer_t *mixer, sb16_regs_t *regs, sb_mixer_type_t type);
 int sb_mixer_get_control_item_count(const sb_mixer_t *mixer);
-int sb_mixer_get_control_item_info(const sb_mixer_t *mixer, unsigned index,
+errno_t sb_mixer_get_control_item_info(const sb_mixer_t *mixer, unsigned index,
     const char **name, unsigned *levels);
-int sb_mixer_get_control_item_value(const sb_mixer_t *mixer, unsigned index,
+errno_t sb_mixer_get_control_item_value(const sb_mixer_t *mixer, unsigned index,
     unsigned *value);
-int sb_mixer_set_control_item_value(const sb_mixer_t *mixer, unsigned index,
+errno_t sb_mixer_set_control_item_value(const sb_mixer_t *mixer, unsigned index,
     unsigned value);
 #endif
Index: uspace/drv/audio/sb16/mixer_iface.c
===================================================================
--- uspace/drv/audio/sb16/mixer_iface.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/mixer_iface.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -46,5 +46,5 @@
 }
 
-static int sb_get_info(ddf_fun_t *fun, const char** name, unsigned *items)
+static errno_t sb_get_info(ddf_fun_t *fun, const char** name, unsigned *items)
 {
 	sb_mixer_t *mixer = fun_to_mixer(fun);
@@ -58,5 +58,5 @@
 }
 
-static int sb_get_item_info(ddf_fun_t *fun, unsigned item, const char** name,
+static errno_t sb_get_item_info(ddf_fun_t *fun, unsigned item, const char** name,
     unsigned *max_level)
 {
@@ -65,5 +65,5 @@
 }
 
-static int sb_set_item_level(ddf_fun_t *fun, unsigned item, unsigned value)
+static errno_t sb_set_item_level(ddf_fun_t *fun, unsigned item, unsigned value)
 {
 	sb_mixer_t *mixer = fun_to_mixer(fun);
@@ -71,5 +71,5 @@
 }
 
-static int sb_get_item_level(ddf_fun_t *fun, unsigned item, unsigned *value)
+static errno_t sb_get_item_level(ddf_fun_t *fun, unsigned item, unsigned *value)
 {
 	sb_mixer_t *mixer = fun_to_mixer(fun);
Index: uspace/drv/audio/sb16/pcm_iface.c
===================================================================
--- uspace/drv/audio/sb16/pcm_iface.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/pcm_iface.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -47,5 +47,5 @@
 }
 
-static int sb_get_info_str(ddf_fun_t *fun, const char** name)
+static errno_t sb_get_info_str(ddf_fun_t *fun, const char** name)
 {
 	if (name)
@@ -59,20 +59,20 @@
 }
 
-static int sb_test_format(ddf_fun_t *fun, unsigned *channels, unsigned *rate,
+static errno_t sb_test_format(ddf_fun_t *fun, unsigned *channels, unsigned *rate,
     pcm_sample_format_t *format)
 {
 	return sb_dsp_test_format(fun_to_dsp(fun), channels, rate, format);
 }
-static int sb_get_buffer(ddf_fun_t *fun, void **buffer, size_t *size)
+static errno_t sb_get_buffer(ddf_fun_t *fun, void **buffer, size_t *size)
 {
 	return sb_dsp_get_buffer(fun_to_dsp(fun), buffer, size);
 }
 
-static int sb_get_buffer_position(ddf_fun_t *fun, size_t *size)
+static errno_t sb_get_buffer_position(ddf_fun_t *fun, size_t *size)
 {
 	return sb_dsp_get_buffer_position(fun_to_dsp(fun), size);
 }
 
-static int sb_set_event_session(ddf_fun_t *fun, async_sess_t *sess)
+static errno_t sb_set_event_session(ddf_fun_t *fun, async_sess_t *sess)
 {
 	return sb_dsp_set_event_session(fun_to_dsp(fun), sess);
@@ -84,10 +84,10 @@
 }
 
-static int sb_release_buffer(ddf_fun_t *fun)
+static errno_t sb_release_buffer(ddf_fun_t *fun)
 {
 	return sb_dsp_release_buffer(fun_to_dsp(fun));
 }
 
-static int sb_start_playback(ddf_fun_t *fun, unsigned frames,
+static errno_t sb_start_playback(ddf_fun_t *fun, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -96,10 +96,10 @@
 }
 
-static int sb_stop_playback(ddf_fun_t *fun, bool immediate)
+static errno_t sb_stop_playback(ddf_fun_t *fun, bool immediate)
 {
 	return sb_dsp_stop_playback(fun_to_dsp(fun), immediate);
 }
 
-static int sb_start_capture(ddf_fun_t *fun, unsigned frames,
+static errno_t sb_start_capture(ddf_fun_t *fun, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -108,5 +108,5 @@
 }
 
-static int sb_stop_capture(ddf_fun_t *fun, bool immediate)
+static errno_t sb_stop_capture(ddf_fun_t *fun, bool immediate)
 {
 	return sb_dsp_stop_capture(fun_to_dsp(fun), immediate);
Index: uspace/drv/audio/sb16/sb16.c
===================================================================
--- uspace/drv/audio/sb16/sb16.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/sb16.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -94,5 +94,5 @@
 }
 
-int sb16_init_sb16(sb16_t *sb, addr_range_t *regs, ddf_dev_t *dev, int dma8,
+errno_t sb16_init_sb16(sb16_t *sb, addr_range_t *regs, ddf_dev_t *dev, int dma8,
     int dma16)
 {
@@ -100,5 +100,5 @@
 
 	/* Setup registers */
-	int ret = pio_enable_range(regs, (void **) &sb->regs);
+	errno_t ret = pio_enable_range(regs, (void **) &sb->regs);
 	if (ret != EOK)
 		return ret;
@@ -179,5 +179,5 @@
 }
 
-int sb16_init_mpu(sb16_t *sb, addr_range_t *regs)
+errno_t sb16_init_mpu(sb16_t *sb, addr_range_t *regs)
 {
 	sb->mpu_regs = NULL;
Index: uspace/drv/audio/sb16/sb16.h
===================================================================
--- uspace/drv/audio/sb16/sb16.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
+++ uspace/drv/audio/sb16/sb16.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -53,6 +53,6 @@
 size_t sb16_irq_code_size(void);
 void sb16_irq_code(addr_range_t *regs, int dma8, int dma16, irq_cmd_t cmds[], irq_pio_range_t ranges[]);
-int sb16_init_sb16(sb16_t *sb, addr_range_t *regs, ddf_dev_t *dev, int dma8, int dma16);
-int sb16_init_mpu(sb16_t *sb, addr_range_t *regs);
+errno_t sb16_init_sb16(sb16_t *sb, addr_range_t *regs, ddf_dev_t *dev, int dma8, int dma16);
+errno_t sb16_init_mpu(sb16_t *sb, addr_range_t *regs);
 void sb16_interrupt(sb16_t *sb);
 
