From 0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 22 Dec 2020 19:30:28 -0700 Subject: dm: Use access methods for dev/uclass private data Most drivers use these access methods but a few do not. Update them. In some cases the access is not permitted, so mark those with a FIXME tag for the maintainer to check. Signed-off-by: Simon Glass Acked-by: Andy Shevchenko Acked-by: Pratyush Yadav --- drivers/gpio/imx_rgpio2p.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpio/imx_rgpio2p.c') diff --git a/drivers/gpio/imx_rgpio2p.c b/drivers/gpio/imx_rgpio2p.c index 17edd40c5c5..a5a290a00ce 100644 --- a/drivers/gpio/imx_rgpio2p.c +++ b/drivers/gpio/imx_rgpio2p.c @@ -11,6 +11,7 @@ #include #include #include +#include #include enum imx_rgpio2p_direction { @@ -151,7 +152,7 @@ static int imx_rgpio2p_probe(struct udevice *dev) static int imx_rgpio2p_bind(struct udevice *dev) { - struct imx_rgpio2p_plat *plat = dev->plat; + struct imx_rgpio2p_plat *plat = dev_get_plat(dev); fdt_addr_t addr; /* @@ -184,7 +185,7 @@ static int imx_rgpio2p_bind(struct udevice *dev) plat->regs = (struct gpio_regs *)addr; plat->bank_index = dev_seq(dev); - dev->plat = plat; + dev_set_plat(dev, plat); return 0; } -- cgit v1.2.3 From 20e442ab2df355450006574fff178c746d254a18 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 28 Dec 2020 20:34:54 -0700 Subject: dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() The current macro is a misnomer since it does not declare a device directly. Instead, it declares driver_info record which U-Boot uses at runtime to create a device. The distinction seems somewhat minor most of the time, but is becomes quite confusing when we actually want to declare a device, with of-platdata. We are left trying to distinguish between a device which isn't actually device, and a device that is (perhaps an 'instance'?) It seems better to rename this macro to describe what it actually is. The macros is not widely used, since boards should use devicetree to declare devices. Rename it to U_BOOT_DRVINFO(), which indicates clearly that this is declaring a new driver_info record, not a device. Signed-off-by: Simon Glass --- drivers/gpio/imx_rgpio2p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpio/imx_rgpio2p.c') diff --git a/drivers/gpio/imx_rgpio2p.c b/drivers/gpio/imx_rgpio2p.c index a5a290a00ce..0e2874ca95c 100644 --- a/drivers/gpio/imx_rgpio2p.c +++ b/drivers/gpio/imx_rgpio2p.c @@ -158,7 +158,7 @@ static int imx_rgpio2p_bind(struct udevice *dev) /* * If plat already exsits, directly return. * Actually only when DT is not supported, plat - * is statically initialized in U_BOOT_DEVICES.Here + * is statically initialized in U_BOOT_DRVINFOS.Here * will return. */ if (plat) @@ -216,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] }, -- cgit v1.2.3