Commit 10340236 authored by Bjorn Helgaas's avatar Bjorn Helgaas

PCI: designware: Rename dw_pcie_valid_config() to dw_pcie_valid_device()

Rename dw_pcie_valid_config() to dw_pcie_valid_device() and use the result
directly as a boolean value instead of testing against 0.  No functional
change intended.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent bdf53098
...@@ -760,8 +760,8 @@ static int dw_pcie_wr_other_conf(struct pcie_port *pp, struct pci_bus *bus, ...@@ -760,8 +760,8 @@ static int dw_pcie_wr_other_conf(struct pcie_port *pp, struct pci_bus *bus,
return ret; return ret;
} }
static int dw_pcie_valid_config(struct pcie_port *pp, static int dw_pcie_valid_device(struct pcie_port *pp, struct pci_bus *bus,
struct pci_bus *bus, int dev) int dev)
{ {
/* If there is no link, then there is no device */ /* If there is no link, then there is no device */
if (bus->number != pp->root_bus_nr) { if (bus->number != pp->root_bus_nr) {
...@@ -781,7 +781,7 @@ static int dw_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, ...@@ -781,7 +781,7 @@ static int dw_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
{ {
struct pcie_port *pp = bus->sysdata; struct pcie_port *pp = bus->sysdata;
if (dw_pcie_valid_config(pp, bus, PCI_SLOT(devfn)) == 0) { if (!dw_pcie_valid_device(pp, bus, PCI_SLOT(devfn))) {
*val = 0xffffffff; *val = 0xffffffff;
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
} }
...@@ -797,7 +797,7 @@ static int dw_pcie_wr_conf(struct pci_bus *bus, u32 devfn, ...@@ -797,7 +797,7 @@ static int dw_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
{ {
struct pcie_port *pp = bus->sysdata; struct pcie_port *pp = bus->sysdata;
if (dw_pcie_valid_config(pp, bus, PCI_SLOT(devfn)) == 0) if (!dw_pcie_valid_device(pp, bus, PCI_SLOT(devfn)))
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
if (bus->number == pp->root_bus_nr) if (bus->number == pp->root_bus_nr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment