Re: [PATCHv5 6/7] eeprom: 93xx46: extend driver to plug into the NVMEM framework
From: Joachim Eastwood
Date: Wed Feb 17 2016 - 17:08:41 EST
On 17 February 2016 at 23:02, Joachim Eastwood <manabian@xxxxxxxxx> wrote:
> Hi Andrew,
>
> On 17 February 2016 at 21:07, Andrew Lunn <andrew@xxxxxxx> wrote:
>> +/*
>> + * Provide a regmap interface, which is registered with the NVMEM
>> + * framework
>> +*/
>> +static int eeprom_93xx46_regmap_read(void *context, const void *reg,
>> + size_t reg_size, void *val,
>> + size_t val_size)
>> +{
>> + struct eeprom_93xx46_dev *eeprom_93xx46 = context;
>> + off_t offset = *(u32 *)reg;
>> + int err;
>> +
>> + err = eeprom_93xx46_read(eeprom_93xx46, val, offset, val_size);
>> + if (err)
>> + return err;
>> + return 0;
>
> Can be:
> return eeprom_93xx46_read(eeprom_93xx46, val, offset, val_size);
>
> Allows you to remove the 'err' variable also.
You seem to do this consistently in the other patches as well. Any
particular reason?
regards,
Joachim Eastwood