Skip to content

Commit 18aa6c8

Browse files
henrikbrixandersenkartben
authored andcommitted
drivers: can: mcan: merge nested if-statements into one
Merge two nested if-statements into one. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
1 parent 45511fe commit 18aa6c8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/can/can_mcan.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,11 +1390,9 @@ int can_mcan_init(const struct device *dev)
13901390
k_mutex_init(&data->tx_mtx);
13911391
k_sem_init(&data->tx_sem, cbs->num_tx, cbs->num_tx);
13921392

1393-
if (config->common.phy != NULL) {
1394-
if (!device_is_ready(config->common.phy)) {
1395-
LOG_ERR("CAN transceiver not ready");
1396-
return -ENODEV;
1397-
}
1393+
if (config->common.phy != NULL && !device_is_ready(config->common.phy)) {
1394+
LOG_ERR("CAN transceiver not ready");
1395+
return -ENODEV;
13981396
}
13991397

14001398
err = can_mcan_exit_sleep_mode(dev);

0 commit comments

Comments
 (0)