diff mbox

[5/6] PCI: Simplify reset_intel_generic_dev()

Message ID 20150619224251.14626.51652.stgit@bhelgaas-glaptop2.roam.corp.google.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Bjorn Helgaas June 19, 2015, 10:42 p.m. UTC
Restructure reset_intel_generic_dev() slightly to return early for non-USB
devices.  That makes the body of the function non-indented.

No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Dexuan Cui <dexuan.cui@intel.com>
CC: Yu Zhao <yu.zhao@intel.com>
---
 drivers/pci/quirks.c |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
diff mbox

Patch

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 356a401..ed2763b2 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3358,21 +3358,20 @@  static int reset_intel_generic_dev(struct pci_dev *dev, int probe)
 	int pos;
 
 	/* only implement PCI_CLASS_SERIAL_USB at present */
-	if ((dev->class >> 8) == PCI_CLASS_SERIAL_USB) {
-		pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
-		if (!pos)
-			return -ENOTTY;
-
-		if (probe)
-			return 0;
+	if ((dev->class >> 8) != PCI_CLASS_SERIAL_USB)
+		return -ENOTTY;
 
-		pci_write_config_byte(dev, pos + 0x4, 1);
-		msleep(100);
+	pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
+	if (!pos)
+		return -ENOTTY;
 
+	if (probe)
 		return 0;
-	} else {
-		return -ENOTTY;
-	}
+
+	pci_write_config_byte(dev, pos + 0x4, 1);
+	msleep(100);
+
+	return 0;
 }
 
 static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, int probe)