Skip to content

Commit 48566d8

Browse files
kartbendkalowsk
authored andcommitted
drivers: sensor: mmc56x3: add error handling in mmc56x3_chip_init
The return code of several initialization functions was being ignored. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 5fd565e commit 48566d8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/sensor/memsic/mmc56x3/mmc56x3.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,16 @@ static int mmc56x3_chip_init(const struct device *dev)
196196
const struct mmc56x3_config *config = &data->config;
197197

198198
ret = mmc56x3_chip_set_continuous_mode(dev, config->magn_odr);
199+
if (ret < 0) {
200+
return ret;
201+
}
199202

200203
ret = mmc56x3_chip_set_decimation_filter(dev, config->bw0, config->bw1);
204+
if (ret < 0) {
205+
return ret;
206+
}
201207

202208
ret = mmc56x3_chip_set_auto_self_reset(dev, config->auto_sr);
203-
204209
if (ret < 0) {
205210
return ret;
206211
}

0 commit comments

Comments
 (0)