diff options
Diffstat (limited to 'drivers/gpio/imx_rgpio2p.c')
-rw-r--r-- | drivers/gpio/imx_rgpio2p.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpio/imx_rgpio2p.c b/drivers/gpio/imx_rgpio2p.c index 1e876f6914..0e2874ca95 100644 --- a/drivers/gpio/imx_rgpio2p.c +++ b/drivers/gpio/imx_rgpio2p.c @@ -11,6 +11,7 @@ #include <fdtdec.h> #include <asm/gpio.h> #include <asm/io.h> +#include <dm/device-internal.h> #include <malloc.h> enum imx_rgpio2p_direction { @@ -132,7 +133,7 @@ static const struct dm_gpio_ops imx_rgpio2p_ops = { static int imx_rgpio2p_probe(struct udevice *dev) { struct imx_rgpio2p_data *bank = dev_get_priv(dev); - struct imx_rgpio2p_plat *plat = dev_get_platdata(dev); + struct imx_rgpio2p_plat *plat = dev_get_plat(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); int banknum; char name[18], *str; @@ -151,13 +152,13 @@ static int imx_rgpio2p_probe(struct udevice *dev) static int imx_rgpio2p_bind(struct udevice *dev) { - struct imx_rgpio2p_plat *plat = dev->platdata; + struct imx_rgpio2p_plat *plat = dev_get_plat(dev); fdt_addr_t addr; /* - * If platdata already exsits, directly return. - * Actually only when DT is not supported, platdata - * is statically initialized in U_BOOT_DEVICES.Here + * If plat already exsits, directly return. + * Actually only when DT is not supported, plat + * is statically initialized in U_BOOT_DRVINFOS.Here * will return. */ if (plat) @@ -171,7 +172,7 @@ static int imx_rgpio2p_bind(struct udevice *dev) * 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. + * to alloc memory for plat. * * For example imx_rgpio2p_plat uses platform data rather than device * tree. @@ -183,8 +184,8 @@ static int imx_rgpio2p_bind(struct udevice *dev) return -ENOMEM; plat->regs = (struct gpio_regs *)addr; - plat->bank_index = dev->req_seq; - dev->platdata = plat; + plat->bank_index = dev_seq(dev); + dev_set_plat(dev, plat); return 0; } @@ -200,7 +201,7 @@ U_BOOT_DRIVER(imx_rgpio2p) = { .id = UCLASS_GPIO, .ops = &imx_rgpio2p_ops, .probe = imx_rgpio2p_probe, - .priv_auto_alloc_size = sizeof(struct imx_rgpio2p_plat), + .priv_auto = sizeof(struct imx_rgpio2p_plat), .of_match = imx_rgpio2p_ids, .bind = imx_rgpio2p_bind, }; @@ -215,7 +216,7 @@ static const struct imx_rgpio2p_plat imx_plat[] = { { 5, (struct gpio_regs *)RGPIO2P_GPIO6_BASE_ADDR }, }; -U_BOOT_DEVICES(imx_rgpio2ps) = { +U_BOOT_DRVINFOS(imx_rgpio2ps) = { { "imx_rgpio2p", &imx_plat[0] }, { "imx_rgpio2p", &imx_plat[1] }, { "imx_rgpio2p", &imx_plat[2] }, |