mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/4] staging: dgnc: remove unneeded else
@ 2016-02-27 12:03 Sudip Mukherjee
  2016-02-27 12:03 ` [PATCH 2/4] staging: dgnc: remove pci_unregister_driver Sudip Mukherjee
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2016-02-27 12:03 UTC (permalink / raw)
  To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
  Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee

If pci_enable_device() fails then we can return directly.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---

I saw there is some pending dgnc patch in outreachy, so this series
might not apply. This series is based on staging-testing.
I will resend v2 if it fails.

 drivers/staging/dgnc/dgnc_driver.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..c32f208 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -283,13 +283,13 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	/* wake up and enable device */
 	rc = pci_enable_device(pdev);
 
-	if (rc < 0) {
-		rc = -EIO;
-	} else {
-		rc = dgnc_found_board(pdev, ent->driver_data);
-		if (rc == 0)
-			dgnc_NumBoards++;
-	}
+	if (rc)
+		return -EIO;
+
+	rc = dgnc_found_board(pdev, ent->driver_data);
+	if (rc == 0)
+		dgnc_NumBoards++;
+
 	return rc;
 }
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-27 12:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-27 12:03 [PATCH 1/4] staging: dgnc: remove unneeded else Sudip Mukherjee
2016-02-27 12:03 ` [PATCH 2/4] staging: dgnc: remove pci_unregister_driver Sudip Mukherjee
2016-02-27 12:03 ` [PATCH 3/4] staging: dgnc: unregister pci driver Sudip Mukherjee
2016-02-27 12:03 ` [PATCH 4/4] staging: dgnc: cleanup properly Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome