Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp569287pxk; Wed, 16 Sep 2020 11:01:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnk947F3yisppbdvdET2JbWIY01WM7ALMcykT4UfBMOOYXX9L/4PFBNdfHN24oT390IwjW X-Received: by 2002:a17:906:3bca:: with SMTP id v10mr26400410ejf.57.1600279302953; Wed, 16 Sep 2020 11:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600279302; cv=none; d=google.com; s=arc-20160816; b=sVi+ADR5NSmEyojPshHjzS3lZD3zyeZZsWAZ3Zxqw/svqSyPkaeT0QKQpRYh8X/y9I MTnkYkm/e8XgYTNbYa6bc8KORK5UGWmM3c5ZGZpBIpkRhzRl8QZz+1UOCMvlyP1Fz0pT regUuI15M80WKVvuGlX2Xjobx1trQnbd+QJQF0I97T3DXpdp2HkexPHyHB+6A3JXG+PR ZoSzfuodpRSKXbSksbwDidmEz8HbitLXuofcrx6O4LVsS2GrW2/N1ZfGAYiHSBsXzVGo DC9e5xSk0rGd7/fHUtEvwNlyd42dHfRbL1bHMR/TyIex74dzjsSyG8gRuuTspuG9rw45 ksww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lYwFJVVyWUnvr3RRMVPcQVxmSTwmiXnhNz3uXivvFZA=; b=jvAWTpt1p3Bg+m0s/Du4pAhoWfFDeLrQs08wP2Mk5dDE0nIGmfBHcj89CuD6p+9yIU yae+HkyhMIy8qbZlZZnyErzbYukA1W8CCMNwNa8zt+v+fksU+/SBmmyh3ibAAPVGvy+T phhX7PXrIlbMLFlH6RxRkhE54w/RTF59LX+Amwk8ChlVE3C4vjQHw/mkFCue/x+WWBzf pMVDp0TxPu89xj/yVOFhsljT+C2/JmJrkJnGNHCzVGmg/oqorFbA3eUGxJzMQ1LI5VxD 4l6KLTziR9MVJxSHidDPRXuLlzD3tcQY6FxEUljISxchAmt8HCT6IX2bkpI+xyOOtHCe u4dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=C1Hh9LyW; 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 u26si12120966edv.154.2020.09.16.11.01.20; Wed, 16 Sep 2020 11:01:42 -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=C1Hh9LyW; 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 S1727376AbgIPR71 (ORCPT + 99 others); Wed, 16 Sep 2020 13:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727452AbgIPR5x (ORCPT ); Wed, 16 Sep 2020 13:57:53 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99BD1C02C2AA for ; Wed, 16 Sep 2020 08:40:06 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id g4so6784466edk.0 for ; Wed, 16 Sep 2020 08:40:06 -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=lYwFJVVyWUnvr3RRMVPcQVxmSTwmiXnhNz3uXivvFZA=; b=C1Hh9LyW50A8UnujcPZRIXI0ouy2JMnjXJvBkcGhAKb2pLUbr1rD4bPI3jdCJXHhnC tx3ak9cITTK4qeciTuBhe8nVxr3oz32O6JPmpklUrcf2776BVokaN923bZ9/rq88Rh5K CF1wLbCxUlvSOeWui43H0Jvz9TEqBo+LVxGxtnCSlu6/rGeSy9LnezIIZbEdZhJ98SIt F9fdJ6pwCbq21caas/gFAcjGFFn4O7xzi5uk7AG7yJSql8cb9NbKx8HG67QxQrrjfa0Y o7Cxv4lii7MsmwlOmqGbeKr/SdJLsWrtqDsad358aHKAYoOJnI+XawOA4KNF9f6Eb5al QZRA== 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=lYwFJVVyWUnvr3RRMVPcQVxmSTwmiXnhNz3uXivvFZA=; b=FvvWJOEC8pcjVjXgGE8OqcDaRFnA6Xq/udzUumKmVYswV7/GAcwRFQupC03bSosgm5 Xys9XosZhYhLvbCZRLBdw3I68CzMTnjisA6/fEb1enygQSOexP7X7g0V+s072fD4mHUk 7lHwu0uAxp3tunn1ueV8p5p+3VVfHTX2b1XsmqJ5/Ilcqb3LXAq7XfvcqhD8YHPzFp6X 2owuxNNi1eBsibxdkYaLMAQSjU1lwnAgWl9lPlYsiaZYDLJpScqDlEALYGXD8/wtDMPj SzuLvNIxDE2eaDOwMWuwe4epxUGpjvsZfBCsgJVu3g/NkboGljQAqvVi4WDSsTA9bK0B oGiA== X-Gm-Message-State: AOAM5320XaRFLbPaqoIndI1w80uzyQ7uUsrs+jDpLSykAoJrsm+IYmm0 QWoxy83iLN+W/gG3NOVq1izRUYxGS8dN78vn/qWzMQ== X-Received: by 2002:a05:6402:17ec:: with SMTP id t12mr27216734edy.328.1600270805229; Wed, 16 Sep 2020 08:40:05 -0700 (PDT) MIME-Version: 1.0 References: <20200916152909.6812-1-vadym.kochan@plvision.eu> In-Reply-To: <20200916152909.6812-1-vadym.kochan@plvision.eu> From: Bartosz Golaszewski Date: Wed, 16 Sep 2020 17:39:54 +0200 Message-ID: Subject: Re: [PATCH] misc: eeprom: set type id as EEPROM for nvmem devices To: Vadym Kochan Cc: Srinivas Kandagatla , Arnd Bergmann , Greg Kroah-Hartman , "Gustavo A. R. Silva" , linux-i2c , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2020 at 5:29 PM Vadym Kochan wrote: > > Set type as NVMEM_TYPE_EEPROM to expose this info via > sysfs: > > $ cat /sys/bus/nvmem/devices/0-00560/type > EEPROM > > Signed-off-by: Vadym Kochan > --- > Checked only with at24. > > drivers/misc/eeprom/at24.c | 1 + > drivers/misc/eeprom/at25.c | 1 + > drivers/misc/eeprom/eeprom_93xx46.c | 1 + > 3 files changed, 3 insertions(+) > > diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c > index 2591c21b2b5d..800300296c74 100644 > --- a/drivers/misc/eeprom/at24.c > +++ b/drivers/misc/eeprom/at24.c > @@ -678,6 +678,7 @@ static int at24_probe(struct i2c_client *client) > return err; > } > > + nvmem_config.type = NVMEM_TYPE_EEPROM; > nvmem_config.name = dev_name(dev); > nvmem_config.dev = dev; > nvmem_config.read_only = !writable; > diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c > index ed8d38b09925..3a586a7c4b1a 100644 > --- a/drivers/misc/eeprom/at25.c > +++ b/drivers/misc/eeprom/at25.c > @@ -348,6 +348,7 @@ static int at25_probe(struct spi_device *spi) > spi_set_drvdata(spi, at25); > at25->addrlen = addrlen; > > + at25->nvmem_config.type = NVMEM_TYPE_EEPROM; > at25->nvmem_config.name = dev_name(&spi->dev); > at25->nvmem_config.dev = &spi->dev; > at25->nvmem_config.read_only = chip.flags & EE_READONLY; > diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c > index 94cfb675fe4e..7c45f82b4302 100644 > --- a/drivers/misc/eeprom/eeprom_93xx46.c > +++ b/drivers/misc/eeprom/eeprom_93xx46.c > @@ -455,6 +455,7 @@ static int eeprom_93xx46_probe(struct spi_device *spi) > edev->pdata = pd; > > edev->size = 128; > + edev->nvmem_config.type = NVMEM_TYPE_EEPROM; > edev->nvmem_config.name = dev_name(&spi->dev); > edev->nvmem_config.dev = &spi->dev; > edev->nvmem_config.read_only = pd->flags & EE_READONLY; > -- > 2.17.1 > Please split it into separate patches - these drivers have different maintainers. Bartosz