On Sat, Sep 25, 2010 at 06:32, <[email protected]> wrote:
> +static void sport_ndso_rx_read(struct sport_dev *dev)
> +{
> + if (cfg->word_len <= 8)
> + while (dev->rx_received < dev->rx_len) {
> + dev->regs->tx16 = 0x00;
> + while (!(dev->regs->stat & RXNE))
> + cpu_relax();
> + u8 *buf = (void *)dev->rx_buf + dev->rx_received;
> + *buf = dev->regs->rx16;
> + dev->rx_received += 1;
> + }
> + else if (cfg->word_len <= 16)
> + while (dev->rx_received < dev->rx_len) {
> + dev->regs->tx16 = 0x0000;
> + while (!(dev->regs->stat & RXNE))
> + cpu_relax();
> + u16 *buf = (void *)dev->rx_buf + dev->rx_received;
> + *buf = dev->regs->rx16;
> + dev->rx_received += 2;
> + }
the buf decl needs to be at the start of the scope. and there doesnt
seem to be 32bit support here.
> +static void sport_ndso_tx_write(struct sport_dev *dev)
> +{
> + if (cfg->word_len <= 8)
> + while (dev->tx_sent < dev->tx_len) {
> + u8 *buf = (void *)dev->tx_buf + dev->tx_sent;
> + dev->regs->tx16 = *buf;
> + dev->tx_sent += 1;
> + while (!(dev->regs->stat & RXNE))
> + cpu_relax();
> + dummy = dev->regs->rx16;
> + }
> + else if (cfg->word_len <= 16) {
> + while (dev->tx_sent < dev->tx_len) {
> + u16 *buf = (void *)dev->tx_buf + dev->tx_sent;
> + dev->regs->tx16 = *buf;
> + dev->tx_sent += 2;
> + while (!(dev->regs->stat & RXNE))
> + cpu_relax();
> + dummy = dev->regs->rx16;
> + }
> + dev->tx_sent = 0;
> + }
this clearing of tx_sent at the end looks like an error. no other tx
code does this. and this func is missing 32bit support.
at any rate, ive fixed this and addressed my previous comments too.
but i only compile tested it. i guess if there's a problem, our
testers will notice.
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits