diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-22 19:30:28 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 12:24:40 -0700 |
commit | 0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d (patch) | |
tree | 1dbc5b936b98393e343cc99a40382b2734ac778e /drivers/gpio/sandbox.c | |
parent | 12559f5bab3e43b603dccfa6c354ffd7da03249c (diff) | |
download | u-boot-0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d.tar.gz |
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 <sjg@chromium.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers/gpio/sandbox.c')
-rw-r--r-- | drivers/gpio/sandbox.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index 2708838adf..489271b560 100644 --- a/drivers/gpio/sandbox.c +++ b/drivers/gpio/sandbox.c @@ -11,6 +11,7 @@ #include <acpi/acpi_device.h> #include <asm/gpio.h> #include <dm/acpi.h> +#include <dm/device-internal.h> #include <dm/device_compat.h> #include <dm/lists.h> #include <dm/of.h> @@ -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; } |