Re: [PATCH v11 07/10] power: bq27xxx_battery: Keep track of specific chip id

Liam Breck
2017-03-23T12:39:21Z

On Thu, Mar 23, 2017 at 5:30 AM, Sebastian Reichel <sre@kernel.org> wrote:
> Hi,
>
> On Thu, Mar 23, 2017 at 03:35:33AM -0700, Liam Breck wrote:
>> On Thu, Mar 23, 2017 at 3:28 AM, Sebastian Reichel <sre@kernel.org> wrote:
>> > Hi,
>> >
>> > On Mon, Mar 20, 2017 at 02:43:32AM -0700, Liam Breck wrote:
>> >> From: Liam Breck <kernel@networkimprov.net>
>> >>
>> >> Pass actual chip ID into _setup(), which translates it to a group ID,
>> >> to allow support for all chips by the power_supply_battery_info code.
>> >> There are no functional changes to the driver.
>> >>
>> >> Signed-off-by: Liam Breck <kernel@networkimprov.net>
>> >
>> > This is really ugly. If we need chip ID and group ID let's store
>> > them in different variables. For example put the detailed chipid
>> > into di->realchip and then do
>>
>> I tried this in a previous version, and Andrew rejected it as
>> confusing to have two IDs. That was while you were away on business
>> :-)
>
> now we have two IDs in the same variable.
> That definitely more confusing. We can name the second variable
> group to reduce confusion.

I was trying not to rename every instance of di->chip; there's a lot.

But we can pass real_chip as an argument to this function, so that
gets you what you wanted.