summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec3fd68)
raw | patch | inline | side by side (parent: ec3fd68)
author | Marek Vasut <marex@denx.de> | |
Sat, 6 Oct 2012 14:07:03 +0000 (14:07 +0000) | ||
committer | Tom Rini <trini@ti.com> | |
Wed, 17 Oct 2012 14:55:50 +0000 (07:55 -0700) |
Reorder serial_assign() function to get rid of the extra level of
indentation. Also, adjust the return value to be -EINVAL instead of
positive one to be more consistent.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
indentation. Also, adjust the return value to be -EINVAL instead of
positive one to be more consistent.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
drivers/serial/serial.c | patch | blob | history |
index d648a73f4113c19257f58284bbe4a4e613e5b40b..3ab323bcb884070cf21b9d24272cf06bee03e36c 100644 (file)
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
#include <stdio_dev.h>
#include <post.h>
#include <linux/compiler.h>
+#include <errno.h>
DECLARE_GLOBAL_DATA_PTR;
struct serial_device *s;
for (s = serial_devices; s; s = s->next) {
- if (strcmp(s->name, name) == 0) {
- serial_current = s;
- return 0;
- }
+ if (strcmp(s->name, name))
+ continue;
+ serial_current = s;
+ return 0;
}
- return 1;
+ return -EINVAL;
}
void serial_reinit_all(void)