aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2007-02-14 03:33:05 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 11:09:52 -0500
commit9b22271d4b8c1be8a81563c322d3f04e7cbe2153 (patch)
tree273fb795f79259cc9fb30c1063719e078b3fa88d /drivers/serial
parent40b36daad0ac704e6d5c1b75789f371ef5b053c1 (diff)
[PATCH] serial: trivial code flow simplification
Return failure immediately, so we don't have to test it twice. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250_pnp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index d3d6b82706b5..cde5db44abf6 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -450,11 +450,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
450 port.dev = &dev->dev; 450 port.dev = &dev->dev;
451 451
452 line = serial8250_register_port(&port); 452 line = serial8250_register_port(&port);
453 if (line < 0)
454 return -ENODEV;
453 455
454 if (line >= 0) 456 pnp_set_drvdata(dev, (void *)((long)line + 1));
455 pnp_set_drvdata(dev, (void *)((long)line + 1)); 457 return 0;
456 return line >= 0 ? 0 : -ENODEV;
457
458} 458}
459 459
460static void __devexit serial_pnp_remove(struct pnp_dev *dev) 460static void __devexit serial_pnp_remove(struct pnp_dev *dev)