Skip to content

Commit a90c4c3

Browse files
mmahadevan108nashif
authored andcommitted
drivers: disk: Fix USDHC driver to return 0 on success
The function usdhc_board_access_init was returning a non-zero value as the variable "ret" is also used to store the GPIO level for card-detect. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent be7faf7 commit a90c4c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/disk/usdhc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,7 @@ static int usdhc_board_access_init(struct usdhc_priv *priv)
26412641
priv->inserted = true;
26422642
} else {
26432643
priv->inserted = false;
2644-
ret = -ENODEV;
2644+
return -ENODEV;
26452645
}
26462646
} else {
26472647
ret = usdhc_cd_gpio_init(priv->detect_gpio,
@@ -2668,7 +2668,7 @@ static int usdhc_board_access_init(struct usdhc_priv *priv)
26682668
priv->inserted = true;
26692669
LOG_INF("SD inserted!");
26702670
}
2671-
return ret;
2671+
return 0;
26722672
}
26732673

26742674
static int usdhc_access_init(const struct device *dev)

0 commit comments

Comments
 (0)