diff options
Diffstat (limited to 'drivers/mci/mci-core.c')
-rw-r--r-- | drivers/mci/mci-core.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index c8d1d5e164..67257bcd18 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -1628,7 +1628,12 @@ static int mci_register_partition(struct mci_part *part) if (np) { of_parse_partitions(&part->blk.cdev, np); - of_partitions_register_fixup(&part->blk.cdev); + + /* bootN-partitions binding barebox-specific, so don't register + * for fixup into kernel device tree + */ + if (part->area_type != MMC_BLK_DATA_AREA_BOOT) + of_partitions_register_fixup(&part->blk.cdev); } return 0; @@ -1650,13 +1655,11 @@ static int mci_card_probe(struct mci *mci) return -ENODEV; } - if (!IS_ERR(host->supply)) { - ret = regulator_enable(host->supply); - if (ret) { - dev_err(&mci->dev, "failed to enable regulator: %s\n", - strerror(-ret)); - return ret; - } + ret = regulator_enable(host->supply); + if (ret) { + dev_err(&mci->dev, "failed to enable regulator: %s\n", + strerror(-ret)); + return ret; } /* start with a host interface reset */ @@ -1728,8 +1731,7 @@ on_error: if (rc != 0) { host->clock = 0; /* disable the MCI clock */ mci_set_ios(mci); - if (!IS_ERR(host->supply)) - regulator_disable(host->supply); + regulator_disable(host->supply); } return rc; @@ -1816,8 +1818,10 @@ int mci_register(struct mci_host *host) mci->dev.detect = mci_detect; host->supply = regulator_get(host->hw_dev, "vmmc"); - if (IS_ERR(host->supply)) + if (IS_ERR(host->supply)) { dev_err(&mci->dev, "Failed to get 'vmmc' regulator.\n"); + host->supply = NULL; + } ret = register_device(&mci->dev); if (ret) @@ -1858,6 +1862,7 @@ void mci_of_parse_node(struct mci_host *host, { u32 bus_width; u32 dsr_val; + const char *alias; if (!IS_ENABLED(CONFIG_OFDEVICE)) return; @@ -1865,6 +1870,10 @@ void mci_of_parse_node(struct mci_host *host, if (!host->hw_dev || !np) return; + alias = of_alias_get(np); + if (alias) + host->devname = xstrdup(alias); + /* "bus-width" is translated to MMC_CAP_*_BIT_DATA flags */ if (of_property_read_u32(np, "bus-width", &bus_width) < 0) { /* If bus-width is missing we get the driver's default, which |