]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PCI: imx6: Simplify a trivial if-return sequence
authorFabio Estevam <fabio.estevam@freescale.com>
Thu, 20 Aug 2015 06:31:58 +0000 (01:31 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 20 Aug 2015 06:31:58 +0000 (01:31 -0500)
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>
drivers/pci/host/pci-imx6.c

index 233a196c6e6661c8dc9aea975a5cf15bf253c2fb..8f3a9813c4e55a5f16ee48e3b54ccd1ec4985702 100644 (file)
@@ -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) */
@@ -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)