pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev);
- -- if (IS_ERR_VALUE(ret)) {
+ ++ if (ret < 0) {
dev_err(dev, "pm_runtime_get_sync failed\n");
-- goto err_phy;
++ goto err_get_sync;
++ }
++
++ gpio_sel = of_get_gpio_flags(dev->of_node, 0, &flags);
++ if (gpio_is_valid(gpio_sel)) {
++ gpio_flags = (flags & OF_GPIO_ACTIVE_LOW) ?
++ GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH;
++ ret = devm_gpio_request_one(dev, gpio_sel, gpio_flags,
++ "pcie_reset");
++ if (ret) {
++ dev_err(&pdev->dev, "gpio%d request failed, ret %d\n",
++ gpio_sel, ret);
++ goto err_gpio;
++ }
++ } else if (gpio_sel == -EPROBE_DEFER) {
++ ret = -EPROBE_DEFER;
++ goto err_gpio;
}
reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_DEVICE_CMD);