public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-i2c@vger.kernel.org
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v3 4/4] nvmem: core: Implement force_ro sysfs attribute
Date: Wed, 26 Jun 2024 18:07:01 +0200	[thread overview]
Message-ID: <ab0cdad7-43e3-4acd-a4cb-b15c1cd26b38@denx.de> (raw)
In-Reply-To: <3e2f38a3-e151-42f1-97ca-b8327ade4acc@linaro.org>

On 6/26/24 3:07 PM, Srinivas Kandagatla wrote:
> 
> 
> On 26/06/2024 05:11, Marek Vasut wrote:
>>   static const struct attribute_group *nvmem_dev_groups[] = {
>> @@ -945,6 +988,7 @@ struct nvmem_device *nvmem_register(const struct 
>> nvmem_config *config)
>>       nvmem->read_only = device_property_present(config->dev, 
>> "read-only") ||
>>                  config->read_only || !nvmem->reg_write;
>> +    nvmem->default_read_only = nvmem->read_only;
>>   #ifdef CONFIG_NVMEM_SYSFS
>>       nvmem->dev.groups = nvmem_dev_groups;
>> diff --git a/drivers/nvmem/internals.h b/drivers/nvmem/internals.h
>> index 18fed57270e5e..0667937ebb86b 100644
>> --- a/drivers/nvmem/internals.h
>> +++ b/drivers/nvmem/internals.h
>> @@ -16,6 +16,7 @@ struct nvmem_device {
>>       int            id;
>>       struct kref        refcnt;
>>       size_t            size;
>> +    bool            default_read_only;
> 
> 
> Its not very clear what is the need for this?

This field is used to discern devices which are by default read-write 
from ones which are by default read-only. Only the former can be 
switched between read-write and read-only mode ; the later cannot be 
switched to read-write mode .

  reply	other threads:[~2024-06-26 16:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26  4:11 [PATCH v3 1/4] nvmem: Replace spaces with tab in documentation Marek Vasut
2024-06-26  4:11 ` [PATCH v3 2/4] nvmem: Document type attribute Marek Vasut
2024-06-26  4:11 ` [PATCH v3 3/4] nvmem: Use sysfs_emit() for " Marek Vasut
2024-06-26  4:11 ` [PATCH v3 4/4] nvmem: core: Implement force_ro sysfs attribute Marek Vasut
2024-06-26 13:07   ` Srinivas Kandagatla
2024-06-26 16:07     ` Marek Vasut [this message]
2024-06-27 14:58       ` Srinivas Kandagatla
2024-06-27 15:55         ` Marek Vasut
2024-06-27 16:21           ` Srinivas Kandagatla
2024-06-27 23:39             ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab0cdad7-43e3-4acd-a4cb-b15c1cd26b38@denx.de \
    --to=marex@denx.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=brgl@bgdev.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox