Merge branch 'pci/ctrl/aardvark'

- Switch to using devm_gpiod_get_optional() so we can stop exporting
  devm_gpiod_get_from_of_node() (Dmitry Torokhov)

* pci/ctrl/aardvark:
  PCI: aardvark: Switch to using devm_gpiod_get_optional()
This commit is contained in:
Bjorn Helgaas 2022-12-10 10:36:40 -06:00
commit 0454c6c0ed

View File

@ -1859,20 +1859,18 @@ static int advk_pcie_probe(struct platform_device *pdev)
return ret;
}
pcie->reset_gpio = devm_gpiod_get_from_of_node(dev, dev->of_node,
"reset-gpios", 0,
GPIOD_OUT_LOW,
"pcie1-reset");
pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
ret = PTR_ERR_OR_ZERO(pcie->reset_gpio);
if (ret) {
if (ret == -ENOENT) {
pcie->reset_gpio = NULL;
} else {
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to get reset-gpio: %i\n",
ret);
return ret;
}
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to get reset-gpio: %i\n", ret);
return ret;
}
ret = gpiod_set_consumer_name(pcie->reset_gpio, "pcie1-reset");
if (ret) {
dev_err(dev, "Failed to set reset gpio name: %d\n", ret);
return ret;
}
ret = of_pci_get_max_link_speed(dev->of_node);