diff options
author | Simon Glass <sjg@chromium.org> | 2017-01-17 16:52:55 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-02-08 06:12:14 -0700 |
commit | e160f7d430f163bc42757aff3bf2bcac0a459f02 (patch) | |
tree | ce006f94b4a52f6fff567eacd86922c3be6df706 /drivers/gpio/atmel_pio4.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/gpio/atmel_pio4.c')
-rw-r--r-- | drivers/gpio/atmel_pio4.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/atmel_pio4.c b/drivers/gpio/atmel_pio4.c index cb90b0241a..81c3047551 100644 --- a/drivers/gpio/atmel_pio4.c +++ b/drivers/gpio/atmel_pio4.c @@ -276,7 +276,7 @@ static const struct dm_gpio_ops atmel_pio4_ops = { static int atmel_pio4_bind(struct udevice *dev) { - return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false); + return dm_scan_fdt_node(dev, gd->fdt_blob, dev_of_offset(dev), false); } static int atmel_pio4_probe(struct udevice *dev) @@ -308,7 +308,8 @@ static int atmel_pio4_probe(struct udevice *dev) pioctrl_data = (struct atmel_pioctrl_data *)dev_get_driver_data(dev); nbanks = pioctrl_data->nbanks; - uc_priv->bank_name = fdt_get_name(gd->fdt_blob, dev->of_offset, NULL); + uc_priv->bank_name = fdt_get_name(gd->fdt_blob, dev_of_offset(dev), + NULL); uc_priv->gpio_count = nbanks * ATMEL_PIO_NPINS_PER_BANK; return 0; |