|
[patch] serial: trivial code flow simplification: msg#00003linux.serial
Return failure immediately, so we don't have to test it twice. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx> Index: work-mm2/drivers/serial/8250_pnp.c =================================================================== --- work-mm2.orig/drivers/serial/8250_pnp.c 2006-08-18 13:02:48.000000000 -0600 +++ work-mm2/drivers/serial/8250_pnp.c 2006-08-18 13:04:14.000000000 -0600 @@ -437,11 +437,11 @@ 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) - To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [PATCH] - add PNP IDs for FPI based touchscreens: 00003, Russell King |
|---|---|
| Next by Date: | Re: [RFC][PATCH] Xilinx uartlite serial driver: 00003, David H. Lynch Jr. |
| Previous by Thread: | [PATCH] - add PNP IDs for FPI based touchscreensi: 00003, Matthew Garrett |
| Next by Thread: | Re: [RFC][PATCH] Xilinx uartlite serial driver: 00003, David H. Lynch Jr. |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |