Skip to content

Commit 40ec42e

Browse files
henrikbrixandersenkartben
authored andcommitted
drivers: can: rcar: merge nested if-statements into one
Merge two nested if-statements into one. Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent 09f54c9 commit 40ec42e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/can/can_rcar.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,11 +1023,9 @@ static int can_rcar_init(const struct device *dev)
10231023
data->common.state_change_cb = NULL;
10241024
data->common.state_change_cb_user_data = NULL;
10251025

1026-
if (config->common.phy != NULL) {
1027-
if (!device_is_ready(config->common.phy)) {
1028-
LOG_ERR("CAN transceiver not ready");
1029-
return -ENODEV;
1030-
}
1026+
if (config->common.phy != NULL && !device_is_ready(config->common.phy)) {
1027+
LOG_ERR("CAN transceiver not ready");
1028+
return -ENODEV;
10311029
}
10321030

10331031
if (!device_is_ready(config->clock_dev)) {

0 commit comments

Comments
 (0)