Skip to content

Commit 389abb8

Browse files
susbys: nfc: replace nrfx_err_t with errno
nrfx_err_t is to be removed from nrfx completely. Signed-off-by: Michał Stasiak <[email protected]>
1 parent 68237b7 commit 389abb8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

subsys/nfc/lib/platform.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void clock_handler(struct onoff_manager *mgr, int res)
109109
nrfx_nfct_state_force(NRFX_NFCT_STATE_ACTIVATED);
110110
}
111111

112-
nrfx_err_t nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t *p_irq_priority)
112+
int nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t *p_irq_priority)
113113
{
114114
int err;
115115

@@ -131,14 +131,14 @@ nrfx_err_t nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t *
131131
err = nfc_platform_internal_init(nfc_lib_cb_resolve);
132132
if (err) {
133133
LOG_ERR("NFC platform init fail: callback resolution function pointer is invalid");
134-
return NRFX_ERROR_NULL;
134+
return -EFAULT;
135135
}
136136

137137
LOG_DBG("NFC platform initialized");
138-
return NRFX_SUCCESS;
138+
return 0;
139139
}
140140

141-
static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3])
141+
static int nfc_platform_tagheaders_get(uint32_t tag_header[3])
142142
{
143143
#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && defined(NRF_FICR_S)
144144
/* If the NFC Platform code is built for the non-secure target and FICR
@@ -156,7 +156,7 @@ static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3])
156156
if (plt_err != TFM_PLATFORM_ERR_SUCCESS || err != 0) {
157157
LOG_ERR("Could not read FICR NFC Tag Header (plt_err %d, err: %d)",
158158
plt_err, err);
159-
return NRFX_ERROR_INTERNAL;
159+
return -ECANCELED;
160160
}
161161

162162
tag_header[0] = ficr_nfc_ns.TAGHEADER0;
@@ -174,27 +174,27 @@ static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3])
174174

175175
#endif /* defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && defined(NRF_FICR_S) */
176176

177-
return NRFX_SUCCESS;
177+
return 0;
178178
}
179179

180-
nrfx_err_t nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf,
180+
int nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf,
181181
uint32_t buf_len)
182182
{
183183
if (!buf) {
184-
return NRFX_ERROR_INVALID_PARAM;
184+
return -EINVAL;
185185
}
186186

187187
if ((buf_len != NRFX_NFCT_NFCID1_SINGLE_SIZE) &&
188188
(buf_len != NRFX_NFCT_NFCID1_DOUBLE_SIZE) &&
189189
(buf_len != NRFX_NFCT_NFCID1_TRIPLE_SIZE)) {
190-
return NRFX_ERROR_INVALID_LENGTH;
190+
return -E2BIG;
191191
}
192192

193-
nrfx_err_t err;
193+
int err;
194194
uint32_t nfc_tag_header[3];
195195

196196
err = nfc_platform_tagheaders_get(nfc_tag_header);
197-
if (err != NRFX_SUCCESS) {
197+
if (err != 0) {
198198
return err;
199199
}
200200

@@ -222,7 +222,7 @@ nrfx_err_t nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf,
222222
}
223223
}
224224

225-
return NRFX_SUCCESS;
225+
return 0;
226226
}
227227

228228
uint8_t *nfc_platform_buffer_alloc(size_t size)

0 commit comments

Comments
 (0)