lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51ab7e73-c973-4348-84c1-f5122808ce94@bootlin.com>
Date: Mon, 5 Jan 2026 11:27:02 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>, David Lechner
 <dlechner@...libre.com>, nuno.sa@...log.com,
 Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Marcelo Schmitt <marcelo.schmitt@...log.com>,
 Matti Vaittinen <mazziesaccount@...il.com>,
 Antoniu Miclaus <antoniu.miclaus@...log.com>,
 Angelo Dureghello <adureghello@...libre.com>,
 Tobias Sperling <tobias.sperling@...ting.com>,
 Eason Yang <j2anfernee@...il.com>,
 Marilene Andrade Garcia <marilene.agarcia@...il.com>,
 Cosmin Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>,
 duje@...emihanovic.xyz, herve.codina@...tlin.com,
 Rodolfo Giometti <giometti@...eenne.com>, linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
 thomas.petazzoni@...tlin.com
Subject: Re: [PATCH 2/2] iio: adc: add driver for Texas Instruments TLA2528
 adc

Hi Andy,

On 29/12/2025 10:39, Andy Shevchenko wrote:
> On Tue, Dec 23, 2025 at 5:55 PM Maxime Chevallier
> <maxime.chevallier@...tlin.com> wrote:
>>
>> This adds a new driver for the TI TLA2528 ADC chip. It ha 8 12-bit
>> channels, that can also be configured as 16-bit averaging channels.
>>
>> Add a very simple driver for it, allowing reading raw values for each
>> channel.
> 
> ...
> 
>> +#include <linux/delay.h>
>> +#include <linux/i2c.h>
>> +#include <linux/module.h>
>> +#include <linux/mod_devicetable.h>
>> +#include <linux/regulator/consumer.h>
> 
> Follow IWYU. Here are missing headers, such as bits.h, mutex.h, types.h.
> 
> ...
> 
>> +       case IIO_CHAN_INFO_SCALE:
>> +               *val = tla2528->vref_uv / 1000;
> 
> (MICRO/MILLI) ?

Absolutely

> 
>> +               *val2 = 12;
>> +
>> +               return IIO_VAL_FRACTIONAL_LOG2;
> 
> 
> 
>> +       tla2528->vref_uv = devm_regulator_get_enable_read_voltage(&client->dev,
>> +                                                                 "vref");
> 
> With
> 
>   struct device *dev = &client->dev;
> 
> at the top of the function this will be one line and others also can
> be shortened.

Ah yes indeed !

> 
>> +       if (tla2528->vref_uv < 0)
>> +               return tla2528->vref_uv;
> 
> ...
> 
>> +       /* Set all inputs as analog */
>> +       ret = tla2528_write_reg(tla2528->client, TLA2528_PIN_CFG_ADR, 0x00);
> 
> Why not simply use the "client"?

Good point

> 
>> +       if (ret < 0)
>> +               return ret;
>> +
>> +       ret = tla2528_write_reg(tla2528->client, TLA2528_DATA_CFG_ADR,
>> +                               TLA2528_DATA_CFG_APPEND_STATUS);
>> +       if (ret < 0)
>> +               return ret;
>> +
>> +       /* Set manual mode */
>> +       ret = tla2528_write_reg(tla2528->client, TLA2528_SEQUENCE_CFG_ADR, 0x00);
>> +       if (ret < 0)
>> +               return ret;
> 
> Ditto.
> 
> ...
> 
>> +static const struct i2c_device_id tla2528_id[] = {
>> +       { "tla2528", 0 },
> 
> No ', 0' part.
> 
>> +       { }
>> +};
> 
> ...
> 
>> +static const struct of_device_id tla2528_of_match[] = {
>> +       { .compatible = "ti,tla2528", },
> 
> No inner comma.
> 
>> +       {  },
> 
> No trailing comma.
> 
>> +};
> 

I'll address these formatting comments as well, thank you for taking a
look :)

Maxime


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ