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/sandbox.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/gpio/sandbox.c') diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index 2708838adf6..489271b560e 100644 --- a/drivers/gpio/sandbox.c +++ b/drivers/gpio/sandbox.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -297,14 +298,15 @@ static int gpio_sandbox_probe(struct udevice *dev) /* Tell the uclass how many GPIOs we have */ uc_priv->gpio_count = CONFIG_SANDBOX_GPIO_COUNT; - dev->priv = calloc(sizeof(struct gpio_state), uc_priv->gpio_count); + dev_set_priv(dev, + calloc(sizeof(struct gpio_state), uc_priv->gpio_count)); return 0; } static int gpio_sandbox_remove(struct udevice *dev) { - free(dev->priv); + free(dev_get_priv(dev)); return 0; } -- cgit v1.2.3