[U-Boot] [PATCH v4 4/8] mips: ath79: add serial driver for ar933x SOC

Thomas Chou
2015-12-27T08:21:54Z

Hi Wills,

On 2015?12?27? 14:28, Wills Wang wrote:
>>> +static int ar933x_serial_putc(struct udevice *dev, const char c)
>>> +{
>>> + u32 data;
>>> +
>>> + if (c == '\n')
>>> + ar933x_serial_putc(dev, '\r');
>> remove this, the serial core driver takes care of it
>>
>>> +
>>> + do {
>>> + data = ar933x_serial_read(dev, AR933X_UART_DATA_REG);
>>> + } while (!(data & AR933X_UART_DATA_TX_CSR));
>> remove this, the serial core driver takes care of it via your pending
>> callback (ar933x_serial_pending)
>>
>
> Serial core driver don't query and wait the pending function before
> "serial_getc" and "serial_putc", so these statements can't remove,
> or board don't work.

As I wrote in the v3 patch review, both the getc() and putc() should
return -EAGAIN if there is no available data to read or not ready to
write. The polling is done in the serial-uclass.c

Regards,
Thomas