Skip to content

Commit b800653

Browse files
mstasiaknordicmasz-nordic
authored andcommitted
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 b4322a3 commit b800653

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
@@ -106,7 +106,7 @@ static void clock_handler(struct onoff_manager *mgr, int res)
106106
nrfx_nfct_state_force(NRFX_NFCT_STATE_ACTIVATED);
107107
}
108108

109-
nrfx_err_t nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t *p_irq_priority)
109+
int nfc_platform_setup(nfc_lib_cb_resolve_t nfc_lib_cb_resolve, uint8_t *p_irq_priority)
110110
{
111111
int err;
112112

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

134134
LOG_DBG("NFC platform initialized");
135-
return NRFX_SUCCESS;
135+
return 0;
136136
}
137137

138-
static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3])
138+
static int nfc_platform_tagheaders_get(uint32_t tag_header[3])
139139
{
140140
#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && defined(NRF_FICR_S)
141141
/* If the NFC Platform code is built for the non-secure target and FICR
@@ -153,7 +153,7 @@ static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3])
153153
if (plt_err != TFM_PLATFORM_ERR_SUCCESS || err != 0) {
154154
LOG_ERR("Could not read FICR NFC Tag Header (plt_err %d, err: %d)",
155155
plt_err, err);
156-
return NRFX_ERROR_INTERNAL;
156+
return -ECANCELED;
157157
}
158158

159159
tag_header[0] = ficr_nfc_ns.TAGHEADER0;
@@ -171,27 +171,27 @@ static nrfx_err_t nfc_platform_tagheaders_get(uint32_t tag_header[3])
171171

172172
#endif /* defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && defined(NRF_FICR_S) */
173173

174-
return NRFX_SUCCESS;
174+
return 0;
175175
}
176176

177-
nrfx_err_t nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf,
177+
int nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf,
178178
uint32_t buf_len)
179179
{
180180
if (!buf) {
181-
return NRFX_ERROR_INVALID_PARAM;
181+
return -EINVAL;
182182
}
183183

184184
if ((buf_len != NRFX_NFCT_NFCID1_SINGLE_SIZE) &&
185185
(buf_len != NRFX_NFCT_NFCID1_DOUBLE_SIZE) &&
186186
(buf_len != NRFX_NFCT_NFCID1_TRIPLE_SIZE)) {
187-
return NRFX_ERROR_INVALID_LENGTH;
187+
return -E2BIG;
188188
}
189189

190-
nrfx_err_t err;
190+
int err;
191191
uint32_t nfc_tag_header[3];
192192

193193
err = nfc_platform_tagheaders_get(nfc_tag_header);
194-
if (err != NRFX_SUCCESS) {
194+
if (err != 0) {
195195
return err;
196196
}
197197

@@ -219,7 +219,7 @@ nrfx_err_t nfc_platform_nfcid1_default_bytes_get(uint8_t * const buf,
219219
}
220220
}
221221

222-
return NRFX_SUCCESS;
222+
return 0;
223223
}
224224

225225
uint8_t *nfc_platform_buffer_alloc(size_t size)

0 commit comments

Comments
 (0)