lkml.org 
[lkml]   [2024]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v3 03/12] net: ethernet: oa_tc6: implement register read operation
>  enum oa_tc6_register_op {
> + OA_TC6_CTRL_REG_READ = 0,
> OA_TC6_CTRL_REG_WRITE = 1,
> };

I thought it looked a little odd when the enum was added in the
previous patch with the first value of 1, and only one value. Now it
makes more sense.

The actual value appears to not matter? It is always

> + if (reg_op == OA_TC6_CTRL_REG_WRITE)

So i would drop the numbering, and leave it to the compiler. The
patches will then look less odd.

> +static int oa_tc6_check_ctrl_read_reply(struct oa_tc6 *tc6, u8 size)
> +{
> + u32 *tx_buf = tc6->spi_ctrl_tx_buf;
> + u32 *rx_buf = tc6->spi_ctrl_rx_buf + OA_TC6_CTRL_IGNORED_SIZE;
> +
> + /* The echoed control read header must match with the one that was
> + * transmitted.
> + */
> + if (*tx_buf != *rx_buf)
> + return -ENODEV;

Another case where -EPROTO might be better?

Andrew

\
 
 \ /
  Last update: 2024-05-27 15:38    [W:0.383 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site