*/
 static int pch_vbus_gpio_init(struct pch_udc_dev *dev)
 {
+       struct device *d = &dev->pdev->dev;
        int err;
        int irq_num = 0;
        struct gpio_desc *gpiod;
        dev->vbus_gpio.intr = 0;
 
        /* Retrieve the GPIO line from the USB gadget device */
-       gpiod = devm_gpiod_get(dev->gadget.dev.parent, NULL, GPIOD_IN);
+       gpiod = devm_gpiod_get(d, NULL, GPIOD_IN);
        if (IS_ERR(gpiod))
                return PTR_ERR(gpiod);
        gpiod_set_consumer_name(gpiod, "pch_vbus");
        if (retval)
                return retval;
 
+       dev->pdev = pdev;
        pci_set_drvdata(pdev, dev);
 
        /* Determine BAR based on PCI ID */
 
        /* device struct setup */
        spin_lock_init(&dev->lock);
-       dev->pdev = pdev;
        dev->gadget.ops = &pch_udc_ops;
 
        retval = init_dma_pools(dev);