Skip to content

Commit 2408ca6

Browse files
committed
drivers: adc: renesas_rz: fix error handling
Fix a bunch of occurrences of API calls returning error codes that were being ignored. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent dafeae0 commit 2408ca6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/adc/adc_renesas_rz.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int adc_rz_channel_setup(const struct device *dev, const struct adc_chann
9898
}
9999
data->fsp_channel_cfg.scan_mask |= (1U << channel_cfg->channel_id);
100100
/** Enable channels. */
101-
config->fsp_api->scanCfg(&data->fsp_ctrl, &data->fsp_channel_cfg);
101+
fsp_err = config->fsp_api->scanCfg(&data->fsp_ctrl, &data->fsp_channel_cfg);
102102

103103
if (FSP_SUCCESS != fsp_err) {
104104
return -ENOTSUP;
@@ -124,8 +124,8 @@ static void adc_rz_isr(const struct device *dev)
124124
/** Get channel ids from scan mask "channels" */
125125
if ((channels & 0x01) != 0) {
126126
/** Read converted data */
127-
config->fsp_api->read(&data->fsp_ctrl, channel_id,
128-
&sample_buffer[data->buf_id]);
127+
fsp_err = config->fsp_api->read(&data->fsp_ctrl, channel_id,
128+
&sample_buffer[data->buf_id]);
129129
if (FSP_SUCCESS != fsp_err) {
130130
break;
131131
}
@@ -288,7 +288,7 @@ static int adc_rz_init(const struct device *dev)
288288
struct adc_rz_data *data = dev->data;
289289
fsp_err_t fsp_err = FSP_SUCCESS;
290290
/**Open the ADC module */
291-
config->fsp_api->open(&data->fsp_ctrl, &data->fsp_cfg);
291+
fsp_err = config->fsp_api->open(&data->fsp_ctrl, &data->fsp_cfg);
292292

293293
if (FSP_SUCCESS != fsp_err) {
294294
return -EIO;

0 commit comments

Comments
 (0)