Re: [PATCH 2/6] mfd: da9063: Replace model with type

From: Marek Vasut
Date: Wed May 23 2018 - 07:28:47 EST


On 05/23/2018 01:55 PM, Geert Uytterhoeven wrote:
> On Wed, May 23, 2018 at 1:42 PM, Marek Vasut <marek.vasut@xxxxxxxxx> wrote:
>> The model number stored in the struct da9063 is the same for all
>> variants of the da9063 since it is the chip ID, which is always
>> the same. Replace that with a separate identifier instead, which
>> allows us to discern the DA9063 variants by setting the type
>> based on either DT match or otherwise.
>>
>> Signed-off-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxx>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
>
>> --- a/drivers/mfd/da9063-i2c.c
>> +++ b/drivers/mfd/da9063-i2c.c
>> @@ -248,6 +248,7 @@ static int da9063_i2c_probe(struct i2c_client *i2c,
>> i2c_set_clientdata(i2c, da9063);
>> da9063->dev = &i2c->dev;
>> da9063->chip_irq = i2c->irq;
>> + da9063->type = (enum da9063_type)id->driver_data;
>
> Nit: I think this cast (from unsigned long) is not needed.

Dropped

--
Best regards,
Marek Vasut