Skip to content

Commit

Permalink
PCI: imx6: Simplify a trivial if-return sequence
Browse files Browse the repository at this point in the history
Simplify a trivial if-return sequence by combining it with a preceding
function call.

The semantic patch that makes this change is available in
scripts/coccinelle/misc/simple_return.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Lucas Stach <l.stach@pengutronix.de>
  • Loading branch information
Fabio Estevam authored and Bjorn Helgaas committed Aug 20, 2015
1 parent bc0195a commit 8d1ceb5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/pci/host/pci-imx6.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ static int pcie_phy_wait_ack(void __iomem *dbi_base, int addr)
val = addr << PCIE_PHY_CTRL_DATA_LOC;
writel(val, dbi_base + PCIE_PHY_CTRL);

ret = pcie_phy_poll_ack(dbi_base, 0);
if (ret)
return ret;

return 0;
return pcie_phy_poll_ack(dbi_base, 0);
}

/* Read from the 16-bit PCIe PHY control registers (not memory-mapped) */
Expand All @@ -148,11 +144,7 @@ static int pcie_phy_read(void __iomem *dbi_base, int addr , int *data)
/* deassert Read signal */
writel(0x00, dbi_base + PCIE_PHY_CTRL);

ret = pcie_phy_poll_ack(dbi_base, 0);
if (ret)
return ret;

return 0;
return pcie_phy_poll_ack(dbi_base, 0);
}

static int pcie_phy_write(void __iomem *dbi_base, int addr, int data)
Expand Down

0 comments on commit 8d1ceb5

Please sign in to comment.