Commit 96edf5376e9250eb61d2bbc5432c13846878edb2

Authored by Andy Shevchenko
Committed by Greg Kroah-Hartman
1 parent ad8ce834bf

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

When ->probe() calls helper functions return theirs error codes
instead of shadowing them.

Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

drivers/parport/parport_serial.c
... ... @@ -539,12 +539,10 @@
539 539 struct serial_private *serial;
540 540  
541 541 board = &pci_parport_serial_boards[id->driver_data];
542   -
543 542 if (board->num_ports == 0)
544 543 return 0;
545 544  
546 545 serial = pciserial_init_ports(dev, board);
547   -
548 546 if (IS_ERR(serial))
549 547 return PTR_ERR(serial);
550 548  
551 549  
552 550  
... ... @@ -630,14 +628,16 @@
630 628 if (err)
631 629 return err;
632 630  
633   - if (parport_register(dev, id))
634   - return -ENODEV;
  631 + err = parport_register(dev, id);
  632 + if (err)
  633 + return err;
635 634  
636   - if (serial_register (dev, id)) {
  635 + err = serial_register(dev, id);
  636 + if (err) {
637 637 int i;
638 638 for (i = 0; i < priv->num_par; i++)
639 639 parport_pc_unregister_port (priv->port[i]);
640   - return -ENODEV;
  640 + return err;
641 641 }
642 642  
643 643 return 0;