lkml.org 
[lkml]   [2016]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] staging: dgnc: remove unneeded else
Date
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
\
 
 \ /
  Last update: 2016-02-27 13:41    [W:0.077 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site