Commit 96edf537 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

parport: Don't shadow error codes in ->probe()

When ->probe() calls helper functions return theirs error codes
instead of shadowing them.
Tested-by: default avatarNikola Ciprich <nikola.ciprich@linuxbox.cz>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ad8ce834
...@@ -539,12 +539,10 @@ static int serial_register(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -539,12 +539,10 @@ static int serial_register(struct pci_dev *dev, const struct pci_device_id *id)
struct serial_private *serial; struct serial_private *serial;
board = &pci_parport_serial_boards[id->driver_data]; board = &pci_parport_serial_boards[id->driver_data];
if (board->num_ports == 0) if (board->num_ports == 0)
return 0; return 0;
serial = pciserial_init_ports(dev, board); serial = pciserial_init_ports(dev, board);
if (IS_ERR(serial)) if (IS_ERR(serial))
return PTR_ERR(serial); return PTR_ERR(serial);
...@@ -630,14 +628,16 @@ static int parport_serial_pci_probe(struct pci_dev *dev, ...@@ -630,14 +628,16 @@ static int parport_serial_pci_probe(struct pci_dev *dev,
if (err) if (err)
return err; return err;
if (parport_register(dev, id)) err = parport_register(dev, id);
return -ENODEV; if (err)
return err;
if (serial_register (dev, id)) { err = serial_register(dev, id);
if (err) {
int i; int i;
for (i = 0; i < priv->num_par; i++) for (i = 0; i < priv->num_par; i++)
parport_pc_unregister_port (priv->port[i]); parport_pc_unregister_port (priv->port[i]);
return -ENODEV; return err;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment