Re: [PATCH v1 03/13] iio: adc: ti-tsc2046: Drop unused member from private data

From: Uwe Kleine-König (The Capable Hub)

Date: Mon Jun 22 2026 - 09:37:24 EST


On Mon, Jun 22, 2026 at 01:30:09PM +0300, Andy Shevchenko wrote:
> On Fri, Jun 19, 2026 at 05:54:31PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > .dcfg is a write only field and thus it can be dropped.
>
> Why isn't squashed with the previous one?

Because they are two different logical changes. But I don't feel strong
here and can squash them together.

> Also, what about struct field and the accompanying data type
> definition?

It took me a while to understand that suggestion. I guess you're talking
about

diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
index 97ecc429db27..125f6d7e2d84 100644
--- a/drivers/iio/adc/ti-tsc2046.c
+++ b/drivers/iio/adc/ti-tsc2046.c
@@ -121,11 +121,6 @@ struct tsc2046_adc_group_layout {
unsigned int skip;
};

-struct tsc2046_adc_dcfg {
- const struct iio_chan_spec *channels;
- unsigned int num_channels;
-};
-
struct tsc2046_adc_ch_cfg {
unsigned int settling_time_us;
unsigned int oversampling_ratio;
@@ -213,11 +208,6 @@ const struct iio_chan_spec name ## _channels[] = { \

static DECLARE_TI_TSC2046_8_CHANNELS(tsc2046_adc, 12);

-static const struct tsc2046_adc_dcfg tsc2046_adc_dcfg_tsc2046e = {
- .channels = tsc2046_adc_channels,
- .num_channels = ARRAY_SIZE(tsc2046_adc_channels),
-};
-
/*
* Convert time to a number of samples which can be transferred within this
* time.
@@ -738,7 +728,6 @@ static void tsc2046_adc_parse_fwnode(struct tsc2046_adc_priv *priv)

static int tsc2046_adc_probe(struct spi_device *spi)
{
- const struct tsc2046_adc_dcfg *dcfg = &tsc2046_adc_dcfg_tsc2046e;
struct device *dev = &spi->dev;
struct tsc2046_adc_priv *priv;
struct iio_dev *indio_dev;
@@ -767,8 +756,8 @@ static int tsc2046_adc_probe(struct spi_device *spi)

indio_dev->name = TI_TSC2046_NAME;
indio_dev->modes = INDIO_DIRECT_MODE;
- indio_dev->channels = dcfg->channels;
- indio_dev->num_channels = dcfg->num_channels;
+ indio_dev->channels = tsc2046_adc_channels;
+ indio_dev->num_channels = ARRAY_SIZE(tsc2046_adc_channels);
indio_dev->info = &tsc2046_adc_info;

ret = devm_regulator_get_enable_read_voltage(dev, "vref");

on top of my changes. Yes, that makes sense.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature