summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-10-05 21:17:21 -0400
committerTom Rini <trini@konsulko.com>2018-10-05 21:17:21 -0400
commit1b484736ce47cb220cb523f00ebe77025cab219f (patch)
treee82ad573068ff2f6be390bacfc2d43c6ed6f8218 /drivers
parenta4b38fca7e83f0556c0afc96492741e4464444df (diff)
parent8be11fb3c1d8d89ff6b60bd3937efcea2dc9c91d (diff)
downloadu-boot-1b484736ce47cb220cb523f00ebe77025cab219f.tar.gz
Merge branch 'master' of git://git.denx.de/u-boot-socfpga
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/dwapb_gpio.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c
index 0f6574d5da..68836a7902 100644
--- a/drivers/gpio/dwapb_gpio.c
+++ b/drivers/gpio/dwapb_gpio.c
@@ -171,8 +171,7 @@ static int gpio_dwapb_bind(struct udevice *dev)
if (!fdtdec_get_bool(blob, node, "gpio-controller"))
continue;
- plat = NULL;
- plat = calloc(1, sizeof(*plat));
+ plat = devm_kcalloc(dev, 1, sizeof(*plat), GFP_KERNEL);
if (!plat)
return -ENOMEM;
@@ -181,23 +180,17 @@ static int gpio_dwapb_bind(struct udevice *dev)
plat->pins = fdtdec_get_int(blob, node, "snps,nr-gpios", 0);
plat->name = fdt_stringlist_get(blob, node, "bank-name", 0,
NULL);
- if (ret)
- goto err;
ret = device_bind(dev, dev->driver, plat->name,
plat, -1, &subdev);
if (ret)
- goto err;
+ return ret;
dev_set_of_offset(subdev, node);
bank++;
}
return 0;
-
-err:
- free(plat);
- return ret;
}
static int gpio_dwapb_remove(struct udevice *dev)