Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp226968pxk; Wed, 16 Sep 2020 02:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/kNZ7YqN508zUHttRi+oS57Jtcy3gLSk2tcMV6CjQzHKGUsCpaM3UTtdh4L7JeBBJcdrM X-Received: by 2002:a17:906:d787:: with SMTP id pj7mr23474069ejb.340.1600249970828; Wed, 16 Sep 2020 02:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600249970; cv=none; d=google.com; s=arc-20160816; b=atSwutzzcZqn1Io1NFScEhsKg48zDz4S3+WwKdYUHzdyr1O/HKyBdgX74RT0fFTAZR uUw0U7GsexpzmbAQwzF7UU3DA5QQ4YIP0f3n3QowHrhXK/lVaysqM+kX1rfLWdUKieVZ fE9Z92guoWZg52b2e9NecgJFoOfLnuZ9ON9O7AajvreNXWFwHtKR7ek0oZFlAT1gPyAW BRNJfzRnm6JrlYVGtUDFOXGD0eCK4U0jry4yNpqjhi9UoMXEoyLpRvKQxlRwxguKBwkU Xu6GdS047sumGqbF/HktB/4THZFJqYuIq2djbvPyEll+WOArj1oaCnjB4N04s9d0ddQv gBIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=jmvtm55itr9eJOTSnEX+409Pt+fxKdfCDE/ObG7O/GE=; b=1CG9r+0vKzRCziOGYvOM9JElXbf7b8oWIAtqw/S90WdXupbOo6VIGznaO5zwCcxIMw ePBx1EVrloF+wIBFARMp0fYjtr/f3dlWAY7uy+cMoNPH95BUQiM/cHX2+OnEk6D/b5if KSEgyuHzLoQw2JBb9ZF5cuNyVWd/4gItvMoAljFEgn0XuXSpsqsiPEmp6I5FwqxtwI3+ EoN2v6Go6er6T3PBOpLheFgMCHG8gSeTNu1Y/euwdrvsjxAQGStlbCid8Md0kWyPnIMA hIuKpu9A/cUSO0STrcclLsSN//Ygy/YhjSztjV6BddGmIzqLnebwFxSl+QFH4Jj1M3uf L6HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=D5BSMD99; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lk17si11138495ejb.188.2020.09.16.02.52.28; Wed, 16 Sep 2020 02:52:50 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=D5BSMD99; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726662AbgIPJuT (ORCPT + 99 others); Wed, 16 Sep 2020 05:50:19 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:12388 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726438AbgIPJuN (ORCPT ); Wed, 16 Sep 2020 05:50:13 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 16 Sep 2020 02:47:51 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 16 Sep 2020 02:50:13 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 16 Sep 2020 02:50:13 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 16 Sep 2020 09:50:12 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 16 Sep 2020 09:50:12 +0000 Received: from moonraker.nvidia.com (Not Verified[10.26.74.242]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Wed, 16 Sep 2020 02:50:12 -0700 From: Jon Hunter To: Bartosz Golaszewski , Rob Herring , Thierry Reding CC: , , , , Jon Hunter Subject: [PATCH V2 1/5] misc: eeprom: at24: Initialise AT24 NVMEM ID field Date: Wed, 16 Sep 2020 10:49:48 +0100 Message-ID: <20200916094952.458003-2-jonathanh@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200916094952.458003-1-jonathanh@nvidia.com> References: <20200916094952.458003-1-jonathanh@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600249671; bh=jmvtm55itr9eJOTSnEX+409Pt+fxKdfCDE/ObG7O/GE=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=D5BSMD999NSmW/YfFUWVQw0Sh1JKISbvb6+atTZAj17ffE67K1oFTolREyiwEnGmp /4VFtDnO4SpQoXnnELXjxf0/ne8dcddYurw9Sg0kcn6cT3XC22fNAQAlvvIde1fL6k 7xWJxjUYZ9E24Mz1402wcCXqS6Ndg05aA6QULdafwsVnpIOSEbPg5ZK1NTADe4WiD9 JOplbHXCukvwVpxUXuYb39aDAyAl9TWfzDcpGycVBD2n9A9YAzTraLWLv/fP0FvCHF bI9h0d2uhFbaaxDEJeOr4Xy7WzKe57U6g3AFGhtaV0ltUnkRKYuDiLg6jNXzkrT5kf k4q362vvJoR5g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AT24 EEPROM driver does not initialise the 'id' field of the nvmem_config structure and because the entire structure is not initialised, it ends up with a random value. This causes the NVMEM driver to append the device 'devid' value to name of the NVMEM device. Ideally for I2C devices such as the AT24 that already have a unique name, we would not bother to append the 'devid'. However, given that this has always been done for AT24 devices, we cannot remove the 'devid' as this will change the name of the userspace sysfs node for the NVMEM device. Nonetheless we should ensure that the 'id' field of the nvmem_config structure is initialised so that there is no chance of a random value causes problems in the future. Therefore, set the NVMEM config.id to NVMEM_DEVID_AUTO for AT24 EEPROMs so that the 'devid' is always appended. Signed-off-by: Jon Hunter --- drivers/misc/eeprom/at24.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index e9df1ca251df..f76624b5c033 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -715,6 +715,7 @@ static int at24_probe(struct i2c_client *client) =20 nvmem_config.name =3D dev_name(dev); nvmem_config.dev =3D dev; + nvmem_config.id =3D NVMEM_DEVID_AUTO; nvmem_config.read_only =3D !writable; nvmem_config.root_only =3D !(flags & AT24_FLAG_IRUGO); nvmem_config.owner =3D THIS_MODULE; --=20 2.25.1