# Re: \[PATCH 12/19\] iio \& mfd \& input: ti\_tscadc: Match mfd sub devices to regmap interface

- From: Sebastian Andrzej Siewior \<hidden\>
- Date: 2013-06-04 10:23:18 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2013/06/8921584
- Thread: https://ratatoskr.run/linux-iio/2013/06/8921584/t.md

```text
* Jonathan Cameron | 2013-06-02 18:46:29 [+0100]:

>On 05/27/2013 08:11 PM, Sebastian Andrzej Siewior wrote:
>> From: Pantelis Antoniou <redacted>
>> 
>Some confusing splitting between this and the previous patch that definitely wants
>to be cleaned up.
>
>> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
>> index cceff09..72ffe89 100644
>> --- a/drivers/iio/adc/ti_am335x_adc.c
>> +++ b/drivers/iio/adc/ti_am335x_adc.c
>> @@ -76,22 +82,24 @@ static void tiadc_step_config(struct tiadc_device *adc_dev)
>>  	tiadc_writel(adc_dev, REG_SE, STPENB_STEPENB);
>>  }
>>  
>> -static int tiadc_channel_init(struct iio_dev *indio_dev, int channels)
>> +static int tiadc_channel_init(struct iio_dev *indio_dev,
>> +		struct tiadc_device *adc_dev)
>>  {
>>  	struct iio_chan_spec *chan_array;
>>  	struct iio_chan_spec *chan;
>>  	char *s;
>>  	int i, len, size, ret;
>> +	int channels = adc_dev->channels;
>This is an unconnected bit of cleanup.  If you want it put it in the previous patch
>which only just introduced what you are changing.

It will be probably best.

>> diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
>> index bd127bd..a27401a 100644
>> --- a/drivers/mfd/ti_am335x_tscadc.c
>> +++ b/drivers/mfd/ti_am335x_tscadc.c
>> @@ -31,6 +31,7 @@ static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg)
>>  {
>>  	unsigned int val;
>>
>????  What is this doing here? It's not doing the move to regmap but rather setting a default value.

No lo sé :) I saw that and was wondering myself a little and planned the
romval of this default for later. Now I think I do this earlier.

>> +	val = (unsigned int)-1;
>>  	regmap_read(tsadc->regmap_tscadc, reg, &val);
>>  	return val;
>>  }

Sebastian
```
