Hi Tristram,

> diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c
> b/drivers/net/dsa/microchip/ksz9477_i2c.c
> new file mode 100644
> index 0000000..29511e9
> --- /dev/null
> +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c
..
> +static int ksz_i2c_read24(struct ksz_device *dev, u32 reg, u32 *val)
> +{
> +     int ret;
> +
> +     *val = 0;
> +     ret = ksz_i2c_read(dev, reg, (u8 *)val, 3);
> +     if (!ret) {
> +             *val = be32_to_cpu(*val);
> +             /* convert to 24bit */
> +             *val >>= 8;
> +     }
> +
> +     return ret;
> +}
> +
> +static int ksz_i2c_write24(struct ksz_device *dev, u32 reg, u32 value)
> +{
> +     /* make it to big endian 24bit from MSB */
> +     value <<= 8;
> +     value = cpu_to_be32(value);
> +     return ksz_i2c_write(dev, reg, &value, 3);
> +}

Is there any specific reason that ksz_i2c_read24 & ksz_i2c_write24 in 
ksz9477_i2c.c
but, other functions are in ksz_i2c.h?

> +
> +static const struct ksz_io_ops ksz9477_i2c_ops = {
> +     .read8 = ksz_i2c_read8,
> +     .read16 = ksz_i2c_read16,
> +     .read24 = ksz_i2c_read24,
> +     .read32 = ksz_i2c_read32,
> +     .write8 = ksz_i2c_write8,
> +     .write16 = ksz_i2c_write16,
> +     .write24 = ksz_i2c_write24,
> +     .write32 = ksz_i2c_write32,
> +     .get = ksz_i2c_get,
> +     .set = ksz_i2c_set,
> +};

Thanks.
Woojung

Reply via email to