diff options
author | Simon Glass <sjg@chromium.org> | 2017-01-18 02:52:55 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-02-08 16:12:14 +0300 |
commit | e160f7d430f163bc42757aff3bf2bcac0a459f02 (patch) | |
tree | ce006f94b4a52f6fff567eacd86922c3be6df706 /drivers/pinctrl/nxp | |
parent | 8aa41363ebf46b9ff63b311bd2aa793c67a49def (diff) | |
download | u-boot-e160f7d430f163bc42757aff3bf2bcac0a459f02.tar.xz |
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/pinctrl/nxp')
-rw-r--r-- | drivers/pinctrl/nxp/pinctrl-imx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pinctrl/nxp/pinctrl-imx.c b/drivers/pinctrl/nxp/pinctrl-imx.c index 949d0f32d8..e130faf876 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx.c +++ b/drivers/pinctrl/nxp/pinctrl-imx.c @@ -19,7 +19,7 @@ static int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config) { struct imx_pinctrl_priv *priv = dev_get_priv(dev); struct imx_pinctrl_soc_info *info = priv->info; - int node = config->of_offset; + int node = dev_of_offset(config); const struct fdt_property *prop; u32 *pin_data; int npins, size, pin_size; @@ -176,7 +176,7 @@ int imx_pinctrl_probe(struct udevice *dev, struct imx_pinctrl_soc_info *info) { struct imx_pinctrl_priv *priv = dev_get_priv(dev); - int node = dev->of_offset, ret; + int node = dev_of_offset(dev), ret; struct fdtdec_phandle_args arg; fdt_addr_t addr; fdt_size_t size; @@ -189,7 +189,8 @@ int imx_pinctrl_probe(struct udevice *dev, priv->dev = dev; priv->info = info; - addr = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg", &size); + addr = fdtdec_get_addr_size(gd->fdt_blob, dev_of_offset(dev), "reg", + &size); if (addr == FDT_ADDR_T_NONE) return -EINVAL; |