]> git.sur5r.net Git - u-boot/blobdiff - drivers/gpio/imx_rgpio2p.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / drivers / gpio / imx_rgpio2p.c
index 5abc88ba5477fec5e044765b0e93cc4836d0f9a5..1e876f69147761ea906c96e581f0b8d201c3ec31 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2016 Freescale Semiconductor, Inc.
  *
  * RGPIO2P driver for the Freescale i.MX7ULP.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -14,8 +13,6 @@
 #include <asm/io.h>
 #include <malloc.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum imx_rgpio2p_direction {
        IMX_RGPIO2P_DIRECTION_IN,
        IMX_RGPIO2P_DIRECTION_OUT,
@@ -168,13 +165,18 @@ static int imx_rgpio2p_bind(struct udevice *dev)
 
        addr = devfdt_get_addr_index(dev, 1);
        if (addr == FDT_ADDR_T_NONE)
-               return -ENODEV;
+               return -EINVAL;
 
        /*
         * TODO:
         * When every board is converted to driver model and DT is supported,
         * this can be done by auto-alloc feature, but not using calloc
         * to alloc memory for platdata.
+        *
+        * For example imx_rgpio2p_plat uses platform data rather than device
+        * tree.
+        *
+        * NOTE: DO NOT COPY this code if you are using device tree.
         */
        plat = calloc(1, sizeof(*plat));
        if (!plat)