summaryrefslogtreecommitdiff
path: root/drivers/gpio/omap_gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/omap_gpio.c')
-rw-r--r--drivers/gpio/omap_gpio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
index b423e34ca4b..7243100219a 100644
--- a/drivers/gpio/omap_gpio.c
+++ b/drivers/gpio/omap_gpio.c
@@ -299,7 +299,7 @@ static int omap_gpio_probe(struct udevice *dev)
static int omap_gpio_bind(struct udevice *dev)
{
- struct omap_gpio_platdata *plat = dev->platdata;
+ struct omap_gpio_platdata *plat = dev_get_platdata(dev);
fdt_addr_t base_addr;
if (plat)
@@ -307,13 +307,17 @@ static int omap_gpio_bind(struct udevice *dev)
base_addr = devfdt_get_addr(dev);
if (base_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 am33xx_gpio 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)