[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hu4yt2a7ipxrqd7ciqqyg4izei2dr7yerpgf7j53quepxj4ed6@gzlv7l3etpqb>
Date: Mon, 19 Aug 2024 22:12:17 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: chris.brandt@...esas.com, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, geert+renesas@...der.be, magnus.damm@...il.com,
p.zabel@...gutronix.de, wsa+renesas@...g-engineering.com,
linux-renesas-soc@...r.kernel.org, linux-i2c@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH v4 08/11] i2c: riic: Add support for fast mode plus
Hi Claudiu,
...
> struct riic_dev {
> @@ -311,11 +315,14 @@ static int riic_init_hw(struct riic_dev *riic)
> int total_ticks, cks, brl, brh;
> struct i2c_timings *t = &riic->i2c_t;
> struct device *dev = riic->adapter.dev.parent;
> + const struct riic_of_data *info = riic->info;
Because you are only using info->fast_mode_plus, perhaps you can
directly take:
fast_mode_plus = riic->info->fast_mode_plus;
and you make it even more compact.
>
> - if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) {
> + if ((!info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) ||
> + (info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_PLUS_FREQ)) {
> dev_err(&riic->adapter.dev,
> - "unsupported bus speed (%dHz). %d max\n",
> - t->bus_freq_hz, I2C_MAX_FAST_MODE_FREQ);
> + "unsupported bus speed (%dHz). %d max\n", t->bus_freq_hz,
super nitpick: can you please put t->bus_freq_hz on a new line,
it looks better to either have everything put in columns or not.
> + info->fast_mode_plus ? I2C_MAX_FAST_MODE_PLUS_FREQ :
> + I2C_MAX_FAST_MODE_FREQ);
another super-nitpick: can you please align
I2C_MAX_FAST_MODE_PLUS_FREQ with I2C_MAX_FAST_MODE_FREQ? It makes
more clear that there is a "? ... :" statement.
Thanks,
Andi
> return -EINVAL;
> }
Powered by blists - more mailing lists