Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5485196pxb; Wed, 26 Jan 2022 13:09:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkgWg8zGa1SU/xmuWNKdH3KAzvcUiuU1VG1P2jInxvhbGIHdbogim3mbHD0v7bHFjuao7I X-Received: by 2002:a17:90b:4d81:: with SMTP id oj1mr775622pjb.216.1643231352310; Wed, 26 Jan 2022 13:09:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643231352; cv=none; d=google.com; s=arc-20160816; b=bO7D2SaJedXxnZ+3zW3VzDSaF05a1Y8h6xkeYM5FQmkx35rK8PwpgMNGAIcBm6mh6Z iuI+eP8Yg3mI4RtBKX+9FBtV+viqZTLkRRDsR6ERuqX7FF+uWps/Ff02bK+7WgR+HfL3 hroK+KbU7XrZ6oLofVq1F4AvCjvPWYEGsJTbQbn6gsVOm7hycZxvCbybvYzFwb4pbEVp U5W2MgWb7qAQHvi2H24uNWiFgW8o0w0RC+f+mJDp10P5Osi8bhPy9sD9LqhHAtKd2Ic1 Zv41J2lqtzav4qkpEARTBGZmGUR8wr/JUQoGyhLXu02iyWzqZWjx32K5vGfZyTxh75lq 4TWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=H/t6x0wjNvcH+Pm2uIo6+5ljVnc5eDc8kZ79gksaerw=; b=s5Qjc+xz/oa/zyP0cyyn6Bx3qkMQg43wJNNKRfCLVP2ve7ElQE2IKD8LJBAGaCjocW BXOMCMyy+KYuRKERRyLDBTDcGYLD2wwKjLK95MZbTP6o2kY3MQQcrl9oH7As0iSmXBpI Mbz0eANtKY5RmYjCNdWZ0r2x1MwVZmI5C6O7DibwhNBXzR5/39tTZJ7fQUzVJQRQVuHp deEI74p//D/9/tdw6d01J2ksbIL0C0eCCswaSZxCyIaO+DL8eZ/MYF5RHX8rVEBackYc GjWnM5sAVvakhqieqbRo8yFrTJjT7ePPQmZ3Nu6lg/WZ+UuiAb+LrsiXnkWiDbeyQFDb JrQw== 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 l10si401010pgp.92.2022.01.26.13.08.59; Wed, 26 Jan 2022 13:09:12 -0800 (PST) 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 S240612AbiAZLTx convert rfc822-to-8bit (ORCPT + 99 others); Wed, 26 Jan 2022 06:19:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233567AbiAZLTw (ORCPT ); Wed, 26 Jan 2022 06:19:52 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8B03C06161C for ; Wed, 26 Jan 2022 03:19:51 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id DC356100002; Wed, 26 Jan 2022 11:19:48 +0000 (UTC) Date: Wed, 26 Jan 2022 12:19:47 +0100 From: Miquel Raynal To: Christophe Kerello Cc: Srinivas Kandagatla , , , , , , , , Subject: Re: [PATCH 3/3] nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property Message-ID: <20220126121947.79890a47@xps13> In-Reply-To: <9662651a-12d9-4893-95c2-aa1a3a10302d@foss.st.com> References: <20220105135734.271313-1-christophe.kerello@foss.st.com> <20220105135734.271313-4-christophe.kerello@foss.st.com> <3f9a9731-c096-bc9b-63df-bd1dff032737@linaro.org> <9662651a-12d9-4893-95c2-aa1a3a10302d@foss.st.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christophe, christophe.kerello@foss.st.com wrote on Wed, 26 Jan 2022 12:08:38 +0100: > Hi Srinivas, Miquel, > > On 1/25/22 11:44, Srinivas Kandagatla wrote: > > > > > > On 05/01/2022 13:57, Christophe Kerello wrote: > >> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > >> index e765d3d0542e..e11c74db64f9 100644 > >> --- a/drivers/nvmem/core.c > >> +++ b/drivers/nvmem/core.c > >> @@ -769,7 +769,7 @@ struct nvmem_device *nvmem_register(const struct >> nvmem_config *config) > >>       if (config->wp_gpio) > >>           nvmem->wp_gpio = config->wp_gpio; > >> -    else > >> +    else if (config->reg_write) > > This is clearly not going to work for everyone. > > > > A flag in nvmem_config to indicate that wp gpio is managed by provider > driver would be the right thing to do here. > > Based on your inputs, I will add a new boolean flag in nvmen_config (proposal name: skip_wp_gpio) and I will set it to true in mtdcore.c when nvmen_config structure is initialized. It will be part of the V2. Fine by me. Thanks for your work on this. > > Regards, > Christophe Kerello. > > >>           nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", > >>                               GPIOD_OUT_HIGH); > > > > --srini > > Cheers, Miquèl