+ if (userial_ports[port])
+ return 0;
+ return -1;
+}
+
+/* Multi serial device functions */
+#define DECLARE_ESERIAL_FUNCTIONS(port) \
+ int userial##port##_init(void) \
+ { return uartlite_serial_init(port); } \
+ void userial##port##_setbrg(void) {} \
+ int userial##port##_getc(void) \
+ { return uartlite_serial_getc(port); } \
+ int userial##port##_tstc(void) \
+ { return uartlite_serial_tstc(port); } \
+ void userial##port##_putc(const char c) \
+ { uartlite_serial_putc(c, port); } \
+ void userial##port##_puts(const char *s) \
+ { uartlite_serial_puts(s, port); }
+
+/* Serial device descriptor */
+#define INIT_ESERIAL_STRUCTURE(port, __name) { \
+ .name = __name, \
+ .start = userial##port##_init, \
+ .stop = NULL, \
+ .setbrg = userial##port##_setbrg, \
+ .getc = userial##port##_getc, \
+ .tstc = userial##port##_tstc, \
+ .putc = userial##port##_putc, \
+ .puts = userial##port##_puts, \