Skip to content

Commit

Permalink
[PATCH] serial: trivial code flow simplification
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Feb 14, 2007
1 parent 40b36da commit 9b22271
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/serial/8250_pnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
port.dev = &dev->dev;

line = serial8250_register_port(&port);
if (line < 0)
return -ENODEV;

if (line >= 0)
pnp_set_drvdata(dev, (void *)((long)line + 1));
return line >= 0 ? 0 : -ENODEV;

pnp_set_drvdata(dev, (void *)((long)line + 1));
return 0;
}

static void __devexit serial_pnp_remove(struct pnp_dev *dev)
Expand Down

0 comments on commit 9b22271

Please sign in to comment.