Merge tag 'u-boot-imx-20200511' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[oweals/u-boot.git] / drivers / pinctrl / pinctrl_pic32.c
index 9acac29133cb900259eab828c7aa90a771060dbe..06f1518c78ff9ed68cf28e2238f26e9236cdd6fb 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Pinctrl driver for Microchip PIC32 SoCs
  * Copyright (c) 2015 Microchip Technology Inc.
  * Written by Purna Chandra Mandal <purna.mandal@microchip.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <dm.h>
@@ -253,7 +252,7 @@ static int pic32_pinctrl_get_periph_id(struct udevice *dev,
        int ret;
        u32 cell[2];
 
-       ret = fdtdec_get_int_array(gd->fdt_blob, periph->of_offset,
+       ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
                                   "interrupts", cell, ARRAY_SIZE(cell));
        if (ret < 0)
                return -EINVAL;
@@ -310,7 +309,7 @@ static int pic32_pinctrl_probe(struct udevice *dev)
        struct pic32_pinctrl_priv *priv = dev_get_priv(dev);
        struct fdt_resource res;
        void *fdt = (void *)gd->fdt_blob;
-       int node = dev->of_offset;
+       int node = dev_of_offset(dev);
        int ret;
 
        ret = fdt_get_named_resource(fdt, node, "reg", "reg-names",