[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96265c60-5b16-4a02-a991-ac0e06f7baf3@tuxon.dev>
Date: Tue, 20 Aug 2024 10:32:29 +0300
From: claudiu beznea <claudiu.beznea@...on.dev>
To: Andi Shyti <andi.shyti@...nel.org>
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, Andi,
On 19.08.2024 23:12, Andi Shyti wrote:
> 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.
I'll adjust everything as suggested.
Thank you,
Claudiu Beznea
>
> Thanks,
> Andi
>
>> return -EINVAL;
>> }
Powered by blists - more mailing lists