/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int serial_getc_dev(const int dev_index)
/* Read a single byte from the serial port. Returns 1 on success, 0 otherwise. When the function is succesfull, the character read is written into its argument c.  */
int serial_getc_dev(const int dev_index)
{
	struct s5pc1xx_uart *const uart = s5pc1xx_get_base_uart(dev_index);
	while (!(readl(&uart->utrstat) & 0x1)) {
		if (serial_err_check(dev_index, 0))
			return 0;
	}
	return (int)(readl(&uart->urxh) & 0xff);
}