Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3804903ybz; Mon, 20 Apr 2020 09:45:07 -0700 (PDT) X-Google-Smtp-Source: APiQypJ9dKPIY29mYVfGauwVBBJWybt4UbqeatMEYFQrIocsv6O8Btd/kzblKgCY8K/91wUtQb6L X-Received: by 2002:a17:906:6d8e:: with SMTP id h14mr16499873ejt.123.1587401107351; Mon, 20 Apr 2020 09:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587401107; cv=none; d=google.com; s=arc-20160816; b=z43f6fEW0EyGKouQ9Un0S9qD+nhvK6AaGj6g8qjKH00OD84y2fXRIVhKx3axeFkwF2 fwMKv1B6HESyhHmrxCAVCUFNH3ee8scQurFGAlapUkSFkm1ihEeOPjy4YOwWZr0OqSGV AzrAVrDtYbr6gqNaOCfP5SWNzBAOocpRJQoytFU8vEWNwip2gt164SjphcGHWmrQRiO8 C34lVec1Toltk12mCuO7Al+p93bD5R8UNgYhZidV0YeJk9rMybojQ1Zo7DkB4g2+c9Tr 4T4Ym+REcGBYoYf7bIjK5v3uBOo3u2zETOhXy2opkS679UujMDw3KNlH15bkKZ6l3Dkf pdnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WiLpx3rePqgVxEPo6ZYXDJhduAiFkpPRu2GVLeYA/GE=; b=EZovCHkcPpD+51S251hVyQeQfqDrk7RCAHXaniLs9u7/DfTM/5QfYSv4YbqCues8iq ynzRJyQzQhFSnKGgjI3VSS3hnbXQaF+aIhOIMqGSnj41p5O9V/PbNOJKQjRO1I12u7O7 wPmN+sUoVxPLxMNLe9BtCo+dQGEqu8+e7EF3sbDwlofPB6S0YG2TnHXisfG2CE7eqR4F D35JtnWBubelfkc3rEhtO7QvJmEQLMQ97Ussl8YitxH4B84pWbB9FJOOSzwOjK7z4p/Y wi4ih8bNC4DNTXszWwZfO1KAkMKncWpFAOUkRpAflUdlpKpjOES7wZeK2/63iUIjxdYX R33w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si877245edn.451.2020.04.20.09.44.43; Mon, 20 Apr 2020 09:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726141AbgDTQnv (ORCPT + 99 others); Mon, 20 Apr 2020 12:43:51 -0400 Received: from sauhun.de ([88.99.104.3]:47794 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbgDTQnv (ORCPT ); Mon, 20 Apr 2020 12:43:51 -0400 Received: from localhost (p54B335B8.dip0.t-ipconnect.de [84.179.53.184]) by pokefinder.org (Postfix) with ESMTPSA id F06262C1F4C; Mon, 20 Apr 2020 18:43:49 +0200 (CEST) Date: Mon, 20 Apr 2020 18:43:49 +0200 From: Wolfram Sang To: Bjorn Ardo Cc: Patrick Williams , =?utf-8?B?QmrDtnJuIEFyZMO2?= , Patrick Williams , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly Message-ID: <20200420164349.GD3721@ninjato> References: <20191001164009.21610-1-alpawi@amazon.com> <150599be-9125-4ab9-e2a6-e792b41910e6@axis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6Nae48J/T25AfBN4" Content-Disposition: inline In-Reply-To: <150599be-9125-4ab9-e2a6-e792b41910e6@axis.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6Nae48J/T25AfBN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 02, 2019 at 08:20:53AM +0200, Bjorn Ardo wrote: > Hi, >=20 >=20 > I sent in another patch earlier that added support for specifying a file = in > devicetree to initilize the eeprom from, corresponding to the case of > pre-flashed eeprom. Maybe these two patches should be merged so this > initialization is only done if no file is specified? Yes, I agree. > /BA >=20 > On 10/1/19 6:40 PM, Patrick Williams wrote: > > The i2c-slave-eeprom driver emulates at24 class eeprom devices, > > which come initialized with all 1s. Do the same in the software > > emulation. > >=20 > > Signed-off-by: Patrick Williams > > --- > > drivers/i2c/i2c-slave-eeprom.c | 2 ++ > > 1 file changed, 2 insertions(+) > >=20 > > diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eep= rom.c > > index db9763cb4dae..efee56106251 100644 > > --- a/drivers/i2c/i2c-slave-eeprom.c > > +++ b/drivers/i2c/i2c-slave-eeprom.c > > @@ -131,6 +131,8 @@ static int i2c_slave_eeprom_probe(struct i2c_client= *client, const struct i2c_de > > if (!eeprom) > > return -ENOMEM; > > + memset(eeprom->buffer, 0xFF, size); > > + > > eeprom->idx_write_cnt =3D 0; > > eeprom->num_address_bytes =3D flag_addr16 ? 2 : 1; > > eeprom->address_mask =3D size - 1; --6Nae48J/T25AfBN4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl6d0UUACgkQFA3kzBSg Kba+gxAAj7fIStG6KAF5VvDWWpM8Pg8kZRzkCLZ+FY8Ihrj3aJT+hTkUaU3BwfCV OXQCQWQP9OHDcSJJbjVq3XyG4b4pAXTuokoCQVX5OjB5b5Oi/RJhpt3U8JFKy/eh x17uULwKA0zUZ05z9iaKcKDy8xNOEkfAdDlJRPdWPx5LJIa0VyGLgeadU+YAtd31 cs/+WKVTMFkA53hAKO+emVlY0yrDzpjBTiBbn9psIhKEyJ78fwEjChUq1m1tF2u5 4Gl4KMvuK5oc0JoNzppsqybDZ67qWqjYT7E99AUPMOBjZwXZiR7BS6v0IatQjn5r 4vdGVPQTZ6NRRAuzq7IjBrj/rVC7qRiAX/0rI6WVCDDa400xA+2zYQDXx2BrceFc 5zTejMPuJheqJ4lESiMgc1gC3BMCpbC8T3CTUqekij4CsakPfQYdpqPXT1L2Y+Rc Cw5YGw6mPn6EJlsmuxzaRYSQvYpH876cTyIw0wX97Pgs9fbY5l8LPicXbgfqTzzO ZQt0YVBz/Z65xhjqlifguiMPvARJX0zyAQ/Gr8zRA2uhH/RIxo7Y4RjvajWjvkLQ jwQXiB5dkB9XX/1DLmMKVf3ADw1gtSjQunKk/cOLt2qNNatVZVivbXQsZfBJz8mZ nm1EeUgEFjGacGrQFjrWDpRlCtOCvRXwWS6meTU+m+mwnyVIERQ= =C9ai -----END PGP SIGNATURE----- --6Nae48J/T25AfBN4--