/* Check if the card is present or not. If no card detect gpio is set, assume the card is present. If reading the gpio fails for some reason, assume the card is there.  */
static bool stm32_sdmmc_card_present(struct stm32_sdmmc_priv *priv)
/* Check if the card is present or not. If no card detect gpio is set, assume the card is present. If reading the gpio fails for some reason, assume the card is there.  */
static bool stm32_sdmmc_card_present(struct stm32_sdmmc_priv *priv)
{
	int err;
	if (!priv->cd.port) {
		return true;
	}
	err = gpio_pin_get_dt(&priv->cd);
	if (err < 0) {
		LOG_WRN("reading card detect failed %d", err);
		return true;
	}
	return err;
}