#include <linux/slab.h>
 #include <linux/spi/spi.h>
 #include <linux/of_device.h>
-#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/regulator/consumer.h>
 #include <sound/asoundef.h>
 #include <sound/core.h>
 
 static int ak4104_spi_probe(struct spi_device *spi)
 {
-       struct device_node *np = spi->dev.of_node;
        struct ak4104_private *ak4104;
+       struct gpio_desc *reset_gpiod;
        unsigned int val;
        int ret;
 
                return ret;
        }
 
-       if (np) {
-               enum of_gpio_flags flags;
-               int gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &flags);
-
-               if (gpio_is_valid(gpio)) {
-                       ret = devm_gpio_request_one(&spi->dev, gpio,
-                                    flags & OF_GPIO_ACTIVE_LOW ?
-                                       GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
-                                    "ak4104 reset");
-                       if (ret < 0)
-                               return ret;
-               }
-       }
+       reset_gpiod = devm_gpiod_get_optional(&spi->dev, "reset",
+                                             GPIOD_OUT_HIGH);
+       if (IS_ERR(reset_gpiod) &&
+           PTR_ERR(reset_gpiod) == -EPROBE_DEFER)
+               return -EPROBE_DEFER;
 
        /* read the 'reserved' register - according to the datasheet, it
         * should contain 0x5b. Not a good way to verify the presence of