diff options
author | Tom Rini <trini@ti.com> | 2014-10-22 13:51:45 -0400 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-10-22 13:51:45 -0400 |
commit | 68e80fdda1336068f40915388bbdacfd2b75233a (patch) | |
tree | deb28e65fdd601e47bf5564f67da3035a840e284 /drivers/serial/serial-uclass.c | |
parent | 35d4fed320d577a4446531d7b9350ce40065c4b0 (diff) | |
parent | 8a9cd5ad6f89ab721a352cbb9264bea5ede68789 (diff) | |
download | u-boot-imx-68e80fdda1336068f40915388bbdacfd2b75233a.zip u-boot-imx-68e80fdda1336068f40915388bbdacfd2b75233a.tar.gz u-boot-imx-68e80fdda1336068f40915388bbdacfd2b75233a.tar.bz2 |
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'drivers/serial/serial-uclass.c')
-rw-r--r-- | drivers/serial/serial-uclass.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 6dde4ea..1a75950 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -71,7 +71,7 @@ void serial_initialize(void) serial_find_console_or_panic(); } -void serial_putc(char ch) +static void serial_putc_dev(struct udevice *dev, char ch) { struct dm_serial_ops *ops = serial_get_ops(cur_dev); int err; @@ -83,6 +83,11 @@ void serial_putc(char ch) serial_putc('\r'); } +void serial_putc(char ch) +{ + serial_putc_dev(cur_dev, ch); +} + void serial_setbrg(void) { struct dm_serial_ops *ops = serial_get_ops(cur_dev); @@ -107,28 +112,32 @@ int serial_tstc(void) return 1; } -int serial_getc(void) +static int serial_getc_dev(struct udevice *dev) { - struct dm_serial_ops *ops = serial_get_ops(cur_dev); + struct dm_serial_ops *ops = serial_get_ops(dev); int err; do { - err = ops->getc(cur_dev); + err = ops->getc(dev); } while (err == -EAGAIN); return err >= 0 ? err : 0; } +int serial_getc(void) +{ + return serial_getc_dev(cur_dev); +} + void serial_stdio_init(void) { } -void serial_stub_putc(struct stdio_dev *sdev, const char ch) +static void serial_stub_putc(struct stdio_dev *sdev, const char ch) { struct udevice *dev = sdev->priv; - struct dm_serial_ops *ops = serial_get_ops(dev); - ops->putc(dev, ch); + serial_putc_dev(dev, ch); } void serial_stub_puts(struct stdio_dev *sdev, const char *str) @@ -140,15 +149,8 @@ void serial_stub_puts(struct stdio_dev *sdev, const char *str) int serial_stub_getc(struct stdio_dev *sdev) { struct udevice *dev = sdev->priv; - struct dm_serial_ops *ops = serial_get_ops(dev); - - int err; - do { - err = ops->getc(dev); - } while (err == -EAGAIN); - - return err >= 0 ? err : 0; + return serial_getc_dev(dev); } int serial_stub_tstc(struct stdio_dev *sdev) |