diff options
Diffstat (limited to 'drivers/gpio/sandbox.c')
-rw-r--r-- | drivers/gpio/sandbox.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index 2708838adf..dc8d506e8d 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> @@ -293,18 +294,19 @@ static int gpio_sandbox_probe(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(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; } @@ -325,7 +327,7 @@ U_BOOT_DRIVER(sandbox_gpio) = { ACPI_OPS_PTR(&gpio_sandbox_acpi_ops) }; -U_BOOT_DRIVER_ALIAS(sandbox_gpio, sandbox_gpio_alias) +DM_DRIVER_ALIAS(sandbox_gpio, sandbox_gpio_alias) /* pincontrol: used only to check GPIO pin configuration (pinmux command) */ |