static int s5p_sdhci_probe(struct udevice *dev) { struct s5p_sdhci_plat *plat = dev_get_platdata(dev); struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct sdhci_host *host = dev_get_priv(dev); int ret; ret = sdhci_get_config(gd->fdt_blob, dev->of_offset, host); if (ret) return ret; ret = do_sdhci_init(host); if (ret) return ret; ret = sdhci_setup_cfg(&plat->cfg, host, 52000000, 400000); if (ret) return ret; host->mmc = &plat->mmc; host->mmc->priv = host; host->mmc->dev = dev; upriv->mmc = host->mmc; return sdhci_probe(dev); }
static int process_nodes(const void *blob, int node_list[], int count) { struct sdhci_host *host; int i, node, ret; int failed = 0; debug("%s: count = %d\n", __func__, count); /* build sdhci_host[] for each controller */ for (i = 0; i < count; i++) { node = node_list[i]; if (node <= 0) continue; host = &sdhci_host[i]; ret = sdhci_get_config(blob, node, host); if (ret) { printf("%s: failed to decode dev %d (%d)\n", __func__, i, ret); failed++; continue; } ret = do_sdhci_init(host); if (ret && ret != -ENODEV) { printf("%s: failed to initialize dev %d (%d)\n", __func__, i, ret); failed++; } } /* we only consider it an error when all nodes fail */ return (failed == count ? -1 : 0); }
static int process_nodes(const void *blob, int node_list[], int count) { struct sdhci_host *host; int i, node; debug("%s: count = %d\n", __func__, count); /* build sdhci_host[] for each controller */ for (i = 0; i < count; i++) { node = node_list[i]; if (node <= 0) continue; host = &sdhci_host[i]; if (sdhci_get_config(blob, node, host)) { printf("%s: failed to decode dev %d\n", __func__, i); return -1; } do_sdhci_init(host); } return 0; }