[PATCH] staging: xillybus: Consolidate return statements in xilly_probe()

Tobias Klauser tklauser at distanz.ch
Wed Jun 18 12:10:21 UTC 2014


No need for two return statements, just call xillybus_do_cleanup() in
case of an error before returning.

Signed-off-by: Tobias Klauser <tklauser at distanz.ch>
---
 drivers/staging/xillybus/xillybus_pcie.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/xillybus/xillybus_pcie.c b/drivers/staging/xillybus/xillybus_pcie.c
index a4fe51c..518ba6c 100644
--- a/drivers/staging/xillybus/xillybus_pcie.c
+++ b/drivers/staging/xillybus/xillybus_pcie.c
@@ -200,11 +200,8 @@ static int xilly_probe(struct pci_dev *pdev,
 	}
 
 	rc = xillybus_endpoint_discovery(endpoint);
-
-	if (!rc)
-		return 0;
-
-	xillybus_do_cleanup(&endpoint->cleanup, endpoint);
+	if (rc)
+		xillybus_do_cleanup(&endpoint->cleanup, endpoint);
 
 	return rc;
 }
-- 
1.7.9.5




More information about the devel mailing list