Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp307393pxk; Thu, 24 Sep 2020 06:19:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF9+Gf9Rl1t9UREgR3ie8RsNymq353fWAqnOdNpANvHpblC7c87pwAZeRRbfeln3/9M4T4 X-Received: by 2002:a17:906:2c44:: with SMTP id f4mr1044609ejh.52.1600953594590; Thu, 24 Sep 2020 06:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600953594; cv=none; d=google.com; s=arc-20160816; b=NphLQqcT89klPksTF8e8ahOVseEubW8APQxkUsgrxJ5FVksKOd+R27ehXGpRmjwIzb 2TlB1BXYKGUSwltC/78qaR6g+tUSO9zqrMqc+7XpRH2q5RRYnNb7z+k0tbkPupGbsU7e tk36IqXDJ9pSEhQgXsLFOeV+HtdgxflpreMOPUaIb+YGyVjgmXr76dM4e9fo0TwGCt8u 3tER4ui80P1l9dXkaugdokefDjx2ezSxGExBQkcOP8M9oKpuTBsTUcmKEhHJs4JB+EDa GQxl9JJxVyxl3QSv+KBh/dIvaOlaNPfePDr/GTIKnmg3wRNmRibgubkncrYoSmcZ3mjw wsRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EqAInrZnqhnwjNUNLFXz1YoHbY4JJ3or1Iv+L0rkS/Q=; b=WMp5MLcbR0b2ZCpNVdO/lZNeinMlWMEJ3+yrPev+VKwT/Jfbv9ygyi4AFOgwhk8xp/ 8A9YomA/V9FyEkRD/ove1skB/9UoWbWkH16sjkMPdObVOfd/pwC9gIkYVwGBfVrw9zF1 PMcSDIaJv+YkRcExquzTo/+LSOvkzyjg2iyxfU4hn+99gaaU8MRc691kLVhqHbYG7TIv Lz3u0mdREK2ut0FQmxxCywfk4yGl1JgvYpo5ZH1PsCenWmzXOWJQVwhQxK3I6IHn2LEV Bl5jduEZd1GYj6m4djY9eDjTyt8jl8pBhKfe48kbzWSMQdCUiYo4XKbz8NkUSXN+Si7y asJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=snyRk+7j; 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 h7si1865794ejl.266.2020.09.24.06.19.27; Thu, 24 Sep 2020 06:19:54 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=snyRk+7j; 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 S1727882AbgIXNRl (ORCPT + 99 others); Thu, 24 Sep 2020 09:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727846AbgIXNRk (ORCPT ); Thu, 24 Sep 2020 09:17:40 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9CAC0613D4 for ; Thu, 24 Sep 2020 06:17:40 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id j2so3308307eds.9 for ; Thu, 24 Sep 2020 06:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EqAInrZnqhnwjNUNLFXz1YoHbY4JJ3or1Iv+L0rkS/Q=; b=snyRk+7jxjEy5mShCyAa6DstNAnU7XvZTPp9k9s3m4avLlzD6cVlDxg4N2QONRPUL4 iqWAV4/X2cagjq6Hc3K+LvIJN1VA61kNSSutlRDRhbgphosAwTpHr2z0uuoHC5keFGuN Byp3a5fPQL/sykDTH5C+81ylNFg+AcFQZ7P3KOR+aktjViqD3ajqJO/pLokVkid6TDnp h3TAMyHsdeXrEA1CsR6ULoZG0hoaywFnhbENtNdHNlFbaF2aNGRYuzurCY93TbebrKP/ 5isNZiOdsp8jGaC8NZByIo1IJihAym57vqK8xVjyrCOaXH0FK3jHfX9BTYqK6S/PThaY +8tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EqAInrZnqhnwjNUNLFXz1YoHbY4JJ3or1Iv+L0rkS/Q=; b=Fk+6z0eyhX8GkXrIc0gbOsSOYz+cod4ZRZiGT96qUJbdm5ZUUbkz0ihG3oP7vEQZof Rx/SRoe3Oyc8Dcg5S2cgB0cQj0tudgbRwoQUJ54DWhCSfmC+h0u2zbq19pVTFQFKoIEw IAvPzM+XZ9tvBLEwSqI/eI7o5gl0a6meHpLtlmvd2sQzzorGh0OnOSywNU8UbV6lniws Kh2DvxIOISO+4jCrOe+JiwOWjerTn/Pv2ACvrGsetVOVrfvs1VQwnYmqoRcdCtVYjsdK 7wcoPBHFnXBpgceBoZeOq6rMT3E2xQSwiUqaIvLXeH62es5kIWmd4TVZBYKVDUPkaJYl nnfw== X-Gm-Message-State: AOAM530kJ0QVEEBz9+bY7aWciYt4W7ZYSlLD5L4xpJXAr6J4sVpW2FKU B5cpeIQksctaKpIcpVWadbpNgJG0Z+sUVfuhY2nKCg== X-Received: by 2002:a05:6402:17ec:: with SMTP id t12mr983133edy.328.1600953458779; Thu, 24 Sep 2020 06:17:38 -0700 (PDT) MIME-Version: 1.0 References: <20200916094952.458003-1-jonathanh@nvidia.com> <20200916094952.458003-2-jonathanh@nvidia.com> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 24 Sep 2020 15:17:28 +0200 Message-ID: Subject: Re: [PATCH V2 1/5] misc: eeprom: at24: Initialise AT24 NVMEM ID field To: Jon Hunter Cc: Rob Herring , Thierry Reding , linux-i2c , linux-devicetree , LKML , linux-tegra@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 3:14 PM Bartosz Golaszewski wrote: > > On Wed, Sep 16, 2020 at 11:50 AM Jon Hunter wrote: > > > > 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) > > > > nvmem_config.name = dev_name(dev); > > nvmem_config.dev = dev; > > + nvmem_config.id = NVMEM_DEVID_AUTO; > > nvmem_config.read_only = !writable; > > nvmem_config.root_only = !(flags & AT24_FLAG_IRUGO); > > nvmem_config.owner = THIS_MODULE; > > -- > > 2.25.1 > > > > Ha! I only now noticed I already have a patch for this in my tree from > Vadym Kochan for this cycle. I'll drop this one. > > Bartosz -ETOOEARLY, nevermind my comment, it's for a different issue. I queued this for v5.10. Thanks! Bartosz