lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGhQ9VwhpY6XhXsOpkN_dDoS0N7e6cDP4pcJVccNYT7KBfAaLg@mail.gmail.com>
Date:	Wed, 17 Feb 2016 23:18:38 +0100
From:	Joachim Eastwood <manabian@...il.com>
To:	Andrew Lunn <andrew@...n.ch>
Cc:	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
	GregKH <greg@...ah.com>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	Wolfram Sang <wsa@...-dreams.de>,
	Mark Brown <broonie@...nel.org>,
	Vladimir Zapolskiy <vz@...ia.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
	bgolaszewski@...libre.com
Subject: Re: [PATCHv5 6/7] eeprom: 93xx46: extend driver to plug into the
 NVMEM framework

On 17 February 2016 at 23:11, Andrew Lunn <andrew@...n.ch> wrote:
> On Wed, Feb 17, 2016 at 11:02:56PM +0100, Joachim Eastwood wrote:
>> Hi Andrew,
>>
>> On 17 February 2016 at 21:07, Andrew Lunn <andrew@...n.ch> wrote:
>> > Add a regmap for accessing the EEPROM, and then use that with the
>> > NVMEM framework. Enable backward compatibility in the MVMEM config
>>
>> typo: MVMEM
>
> Thanks
>
>> > +/*
>> > + * 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.
>
> Nope. regmap wants a return value of 0 or error. eeprom_93xx46_read()
> returns how many bytes where actually read. So we either need this
> code here, or we change the return from eeprom_93xx46_read().

ah, my bad. Sorry about that.


regards,
Joachim Eastwood

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ