From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
linux-kernel@vger.kernel.org,
Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 4/8] parport: Don't shadow error codes in ->probe()
Date: Fri, 2 Feb 2018 20:39:51 +0200 [thread overview]
Message-ID: <20180202183955.85453-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20180202183955.85453-1-andriy.shevchenko@linux.intel.com>
When ->probe() calls helper functions return theirs error codes
instead of shadowing them.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/parport/parport_serial.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index ac72ad1cabf5..7cf847e6e660 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -536,12 +536,10 @@ static int serial_register(struct pci_dev *dev, const struct pci_device_id *id)
struct serial_private *serial;
board = &pci_parport_serial_boards[id->driver_data];
-
if (board->num_ports == 0)
return 0;
serial = pciserial_init_ports(dev, board);
-
if (IS_ERR(serial))
return PTR_ERR(serial);
@@ -627,14 +625,16 @@ static int parport_serial_pci_probe(struct pci_dev *dev,
if (err)
return err;
- if (parport_register(dev, id))
- return -ENODEV;
+ err = parport_register(dev, id);
+ if (err)
+ return err;
- if (serial_register (dev, id)) {
+ err = serial_register(dev, id);
+ if (err) {
int i;
for (i = 0; i < priv->num_par; i++)
parport_pc_unregister_port (priv->port[i]);
- return -ENODEV;
+ return err;
}
return 0;
--
2.15.1
next prev parent reply other threads:[~2018-02-02 18:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 18:39 [PATCH v1 1/8] parport: Add support for BrainBoxes PX272/PX306 MIO card Andy Shevchenko
2018-02-02 18:39 ` [PATCH v1 2/8] parport: PCI core handles power state for us Andy Shevchenko
2018-02-04 16:01 ` Nikola Ciprich
2018-02-02 18:39 ` [PATCH v1 3/8] parport: Convert to use managed functions pcim_* and devm_* Andy Shevchenko
2018-02-04 16:02 ` Nikola Ciprich
2018-02-02 18:39 ` Andy Shevchenko [this message]
2018-02-04 16:02 ` [PATCH v1 4/8] parport: Don't shadow error codes in ->probe() Nikola Ciprich
2018-02-02 18:39 ` [PATCH v1 5/8] parport: Convert printk(KERN_WARN) to dev_warn() Andy Shevchenko
2018-02-04 16:02 ` Nikola Ciprich
2018-02-02 18:39 ` [PATCH v1 6/8] parport: Switch to use module_pci_driver() macro Andy Shevchenko
2018-02-04 16:02 ` Nikola Ciprich
2018-02-02 18:39 ` [PATCH v1 7/8] parport: Sort headers alphabetically Andy Shevchenko
2018-02-04 16:02 ` Nikola Ciprich
2018-02-02 18:39 ` [PATCH v1 8/8] parport: Replace short License header by SPDX identifier Andy Shevchenko
2018-02-04 16:03 ` Nikola Ciprich
2018-02-02 22:07 ` [PATCH v1 1/8] parport: Add support for BrainBoxes PX272/PX306 MIO card Nikola Ciprich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180202183955.85453-4-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nikola.ciprich@linuxbox.cz \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.