/* set GPIO pin 'gpio' as an input */
 static int at91_gpio_direction_input(struct udevice *dev, unsigned offset)
 {
-       struct at91_port_priv *port = dev_get_platdata(dev);
+       struct at91_port_priv *port = dev_get_priv(dev);
 
        at91_set_port_input(port->regs, offset, 0);
 
 static int at91_gpio_direction_output(struct udevice *dev, unsigned offset,
                                       int value)
 {
-       struct at91_port_priv *port = dev_get_platdata(dev);
+       struct at91_port_priv *port = dev_get_priv(dev);
 
        at91_set_port_output(port->regs, offset, value);
 
 /* read GPIO IN value of pin 'gpio' */
 static int at91_gpio_get_value(struct udevice *dev, unsigned offset)
 {
-       struct at91_port_priv *port = dev_get_platdata(dev);
+       struct at91_port_priv *port = dev_get_priv(dev);
 
        return at91_get_port_value(port->regs, offset);
 }
 static int at91_gpio_set_value(struct udevice *dev, unsigned offset,
                               int value)
 {
-       struct at91_port_priv *port = dev_get_platdata(dev);
+       struct at91_port_priv *port = dev_get_priv(dev);
 
        at91_set_port_value(port->regs, offset, value);
 
 
 static int at91_gpio_get_function(struct udevice *dev, unsigned offset)
 {
-       struct at91_port_priv *port = dev_get_platdata(dev);
+       struct at91_port_priv *port = dev_get_priv(dev);
 
        /* GPIOF_FUNC is not implemented yet */
        if (at91_get_port_output(port->regs, offset))