Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2543333imu; Thu, 29 Nov 2018 06:39:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/VQNWx0EdT6u86Bi/j/qmYgRv6w+7CsNYJnkNvKyd7uFmCuHclK5HCsgK1nQ6TQjHFJcWVK X-Received: by 2002:a63:504d:: with SMTP id q13mr1463380pgl.319.1543502368975; Thu, 29 Nov 2018 06:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543502368; cv=none; d=google.com; s=arc-20160816; b=EJ+T8yCUfuv43+frm80YEbs/cWzCEw1IMoBkB6NGWZpFpgdY98bSkbm14ZCi0kgRVn GmmIss5b1E5kTiAZpuyfzZgzpBAfcNKPSH4fTP6DMklk+hRZ1wfCJDgBGOlGbi6RuEvP m9JskissOxGDaEW1piO9VxTzedL5EI8KqkE7W5VNN/LgazM3D6fU6UlPMIt80t7zfqnO ShIr+5kZvMXIkFjTCZBtA9uCSfr+RkwenHUYOts9fs8s5IOwPAL2+TESM2Nf0OYkaFvt ZimVpsX9FGqLGDIqnpPWcwSRlg7UyhhL1oul3/PkbBlfNcOnqzmPL8FzWHEUOskOwZeE fn6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Xk1badHB3Pszc/2Ox5HABkhqz2zqm/wifQJVGrgvRpo=; b=njY+UNnt6DR69SpC3L9GyNVPjbTuWRcqrrPsv9Icdacg13Y/uX8WDsDNFSgwuaiu6o sDHQ5A9Cyutdg+0YvTRDFn3+5HglhlQc/c84Nx6O2hWmrn+aLrgieg9ZTYCIkjMuh9y0 gYQXAAN2NHQpm+GwTJdcagnRcNU81k+SM2aMolGADAB3fUREVeqUwfCqHaUQXW1tgItL RZoKMQSpsihw050Kj4u+nkS2lgkQVVrEdtiYtu7GbDxMRT+boepEY68QsydD9PsYDUZJ BRhVgWIrI3xJor5B0WzBbVbpYE0UFtKC3bhDKbwU7bavi1LtmFTpXmzwM4Aced/dL2ly +OOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=O0SG9DMk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si2456437plc.332.2018.11.29.06.39.14; Thu, 29 Nov 2018 06:39:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=O0SG9DMk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388811AbeK3BgE (ORCPT + 99 others); Thu, 29 Nov 2018 20:36:04 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:54605 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388794AbeK3BgD (ORCPT ); Thu, 29 Nov 2018 20:36:03 -0500 Received: by mail-it1-f196.google.com with SMTP id i145so2931469ita.4 for ; Thu, 29 Nov 2018 06:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Xk1badHB3Pszc/2Ox5HABkhqz2zqm/wifQJVGrgvRpo=; b=O0SG9DMkSPtIy0zynzHlzK6BMkPbTZojrCEAHz0Ylj7Tx65Tsb1hctHTqP0qzwc8Xz gS7UzgbV1rng80gss0sfMwXl3JiuLBjREjwumylgofUdHK3hWZ7BWI9cByfM1/APHvEb DaDJd/o0M+Cx0Sr7VnZMuVtUiAdsMMHJkC+L77Lw3Ik3vobp/meJhTgt7k4opJVVXU85 6KKrovk0FIJ/DrltnrFeVptBqxftw+YT8K/XIpUOV13Z/nDt20KdZvLvJOaWigh8VNSM EMJxZSWCooyA1IsriqXwAeTgaAQPIBXVVuC4zmX9s63qR6MWMlz0blAI75xi5q4gDqyj UfOQ== 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:content-transfer-encoding; bh=Xk1badHB3Pszc/2Ox5HABkhqz2zqm/wifQJVGrgvRpo=; b=nNPcsoDTlRi1gFmvarng5R8dZpG0/j7ktG0g28pbGJqfOlHWmlKSNHVPF4LuBx6HKu 2Klo2fJhAOnmqGQl+B20rAjLGwc/4hVKo/aNAnB+nmHgoZulw7Z5d/Zj9FARr+Rl81qB 7Dlr6teDcpqEON4KWwGcRqF6vT2F8rIV5jOUj0F/XEYvGf9xWqm9EyeadC3QVcqzsjvV 3zCwUX3+DXpS/fgqa8DJr+PBvxbv8iTGskBZaSxpph1Z+8OyWIQ87nBvatobIXYRZDfB PstlHDqlRVxMCJCIzZ09g00CX3zZSR7uLiyGzDPazYRexOwmg59EAhivj00P7H0z1IlR o5WQ== X-Gm-Message-State: AA+aEWbI9tc4PBx0yVyG90HXvYCg9DI4ldQAONCdFTg35ZxOdsLVKSpm fbFF6mDMjf2Z3KXmi6H3AfHp318rYOox/wcJQqcp0g== X-Received: by 2002:a24:7284:: with SMTP id x126mr1787531itc.96.1543501830394; Thu, 29 Nov 2018 06:30:30 -0800 (PST) MIME-Version: 1.0 References: <20181113140133.17385-1-brgl@bgdev.pl> <20181113140133.17385-2-brgl@bgdev.pl> In-Reply-To: <20181113140133.17385-2-brgl@bgdev.pl> From: Bartosz Golaszewski Date: Thu, 29 Nov 2018 15:30:19 +0100 Message-ID: Subject: Re: [PATCH v2 01/25] nvmem: add new config option To: Srinivas Kandagatla Cc: Linux Kernel Mailing List , Linux ARM , Arnd Bergmann , linux-i2c , "open list:MEMORY TECHNOLOGY..." , Kevin Hilman , Bartosz Golaszewski , Sekhar Nori , Boris Brezillon , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wt., 13 lis 2018 o 15:01 Bartosz Golaszewski napisa=C5=82(a= ): > > From: Bartosz Golaszewski > > We want to add nvmem support for MTD. TI DaVinci is the first platform > that will be using it, but only in non-DT mode. In order not to > introduce any new interface to supporting of which we would have to > commit - add a new config option that tells nvmem not to use the DT > node of the parent device. > > This way we won't be creating nvmem devices corresponding with MTD > partitions defined in device tree. By default MTD will set this new > field to true. > > Once a set of bindings for MTD nvmem cells is agreed upon, we'll be > able to remove this option. > > Signed-off-by: Bartosz Golaszewski > --- > drivers/nvmem/core.c | 3 ++- > include/linux/nvmem-provider.h | 2 ++ > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > index 9b18ce90f907..ac7971e8154e 100644 > --- a/drivers/nvmem/core.c > +++ b/drivers/nvmem/core.c > @@ -604,7 +604,8 @@ struct nvmem_device *nvmem_register(const struct nvme= m_config *config) > nvmem->priv =3D config->priv; > nvmem->reg_read =3D config->reg_read; > nvmem->reg_write =3D config->reg_write; > - nvmem->dev.of_node =3D config->dev->of_node; > + if (!config->no_of_node) > + nvmem->dev.of_node =3D config->dev->of_node; > > if (config->id =3D=3D -1 && config->name) { > dev_set_name(&nvmem->dev, "%s", config->name); > diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provide= r.h > index 1e3283c2af77..e53545e9852b 100644 > --- a/include/linux/nvmem-provider.h > +++ b/include/linux/nvmem-provider.h > @@ -30,6 +30,7 @@ typedef int (*nvmem_reg_write_t)(void *priv, unsigned i= nt offset, > * @ncells: Number of elements in cells. > * @read_only: Device is read-only. > * @root_only: Device is accessibly to root only. > + * @no_of_node: Device should not use the parent's of_node even i= f it's !NULL. > * @reg_read: Callback to read data. > * @reg_write: Callback to write data. > * @size: Device size. > @@ -53,6 +54,7 @@ struct nvmem_config { > int ncells; > bool read_only; > bool root_only; > + bool no_of_node; > nvmem_reg_read_t reg_read; > nvmem_reg_write_t reg_write; > int size; > -- > 2.19.1 > Hi Srinivas, if there are no objections - can you Ack this patch for Greg to pick up into char-misc? Bart