diff options
author | Simon Glass | 2017-01-17 16:52:55 -0700 |
---|---|---|
committer | Simon Glass | 2017-02-08 06:12:14 -0700 |
commit | e160f7d430f163bc42757aff3bf2bcac0a459f02 (patch) | |
tree | ce006f94b4a52f6fff567eacd86922c3be6df706 /drivers/mmc/xenon_sdhci.c | |
parent | 8aa41363ebf46b9ff63b311bd2aa793c67a49def (diff) |
dm: core: Replace of_offset with accessor
At present devices use a simple integer offset to record the device tree
node associated with the device. In preparation for supporting a live
device tree, which uses a node pointer instead, refactor existing code to
access this field through an inline function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mmc/xenon_sdhci.c')
-rw-r--r-- | drivers/mmc/xenon_sdhci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c index 828da111c80..f6781102398 100644 --- a/drivers/mmc/xenon_sdhci.c +++ b/drivers/mmc/xenon_sdhci.c @@ -405,7 +405,8 @@ static int xenon_sdhci_probe(struct udevice *dev) armada_3700_soc_pad_voltage_set(host); host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_DDR_52MHz; - switch (fdtdec_get_int(gd->fdt_blob, dev->of_offset, "bus-width", 1)) { + switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width", + 1)) { case 8: host->host_caps |= MMC_MODE_8BIT; break; @@ -455,7 +456,7 @@ static int xenon_sdhci_ofdata_to_platdata(struct udevice *dev) if (of_device_is_compatible(dev, "marvell,armada-3700-sdhci")) priv->pad_ctrl_reg = (void *)dev_get_addr_index(dev, 1); - name = fdt_getprop(gd->fdt_blob, dev->of_offset, "marvell,pad-type", + name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "marvell,pad-type", NULL); if (name) { if (0 == strncmp(name, "sd", 2)) { |