Skip to content

Commit 98c8ce3

Browse files
[nrf fromlist] drivers: align to nrfx PPI driver return errno
NRFX drivers now return errno codes, aligned driver. Upstream PR #: 97997 Signed-off-by: Michał Stasiak <[email protected]>
1 parent a25943c commit 98c8ce3

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

drivers/counter/counter_nrfx_rtc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ static int ppi_setup(const struct device *dev, uint8_t chan)
380380
NRF_RTC_Type *rtc = nrfx_config->rtc;
381381
nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan);
382382
nrfx_err_t result;
383+
int ret;
383384

384385
if (!nrfx_config->use_ppi) {
385386
return 0;
@@ -405,10 +406,10 @@ static int ppi_setup(const struct device *dev, uint8_t chan)
405406
evt_addr = nrfy_rtc_event_address_get(rtc, evt);
406407
task_addr = nrfy_rtc_task_address_get(rtc, NRF_RTC_TASK_CLEAR);
407408

408-
result = nrfx_ppi_channel_alloc(&data->ppi_ch);
409-
if (result != NRFX_SUCCESS) {
409+
ret = nrfx_ppi_channel_alloc(&data->ppi_ch);
410+
if (ret != 0) {
410411
ERR("Failed to allocate PPI channel.");
411-
return -ENODEV;
412+
return ret;
412413
}
413414
(void)nrfx_ppi_channel_assign(data->ppi_ch, evt_addr, task_addr);
414415
(void)nrfx_ppi_channel_enable(data->ppi_ch);

drivers/display/display_nrf_led_matrix.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,19 +438,20 @@ static int instance_init(const struct device *dev)
438438
nrf_pwm_shorts_set(dev_config->pwm, NRF_PWM_SHORT_SEQEND0_STOP_MASK);
439439
#else
440440
nrfx_err_t err;
441+
int ret;
441442
nrf_ppi_channel_t ppi_ch;
442443

443444
for (int i = 0; i < GROUP_SIZE; ++i) {
444445
uint8_t *gpiote_ch = &dev_data->gpiote_ch[i];
445446

446-
err = nrfx_ppi_channel_alloc(&ppi_ch);
447-
if (err != NRFX_SUCCESS) {
447+
ret = nrfx_ppi_channel_alloc(&ppi_ch);
448+
if (ret != 0) {
448449
LOG_ERR("Failed to allocate PPI channel.");
449450
/* Do not bother with freeing resources allocated
450451
* so far. The application needs to be reconfigured
451452
* anyway.
452453
*/
453-
return -ENOMEM;
454+
return ret;
454455
}
455456

456457
err = nrfx_gpiote_channel_alloc(&dev_config->gpiote, gpiote_ch);

drivers/timer/nrf_rtc_timer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ static int sys_clock_driver_init(void)
806806
alloc_mask &= ~BIT(WRAP_CH);
807807

808808
nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(WRAP_CH);
809-
nrfx_err_t result;
809+
int result;
810810
nrf_ppi_channel_t ch;
811811

812812
nrfy_rtc_event_enable(RTC, NRF_RTC_CHANNEL_INT_MASK(WRAP_CH));
@@ -818,8 +818,8 @@ static int sys_clock_driver_init(void)
818818
task_addr = nrfy_rtc_task_address_get(RTC, NRF_RTC_TASK_CLEAR);
819819

820820
result = nrfx_ppi_channel_alloc(&ch);
821-
if (result != NRFX_SUCCESS) {
822-
return -ENODEV;
821+
if (result != 0) {
822+
return result;
823823
}
824824
(void)nrfx_ppi_channel_assign(ch, evt_addr, task_addr);
825825
(void)nrfx_ppi_channel_enable(ch);

0 commit comments

Comments
 (0)