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: Thu, 27 Jun 2024 17:55:00 +0200 [thread overview]
Message-ID: <5ee8b82e-72cb-4644-889c-1959a2318d1a@denx.de> (raw)
In-Reply-To: <55e6f035-fc43-4a56-9bf6-3a1a0e63b85c@linaro.org>
On 6/27/24 4:58 PM, Srinivas Kandagatla wrote:
>
>
> On 26/06/2024 17:07, Marek Vasut wrote:
>> 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
> provider drivers or any drivers should not be accessing this struct
> directly.
>
>> from ones which are by default read-only. Only the former can be
> Why should the drivers care about this?
> If the read_only flag is set in the core, nvmem core should prohibit any
> writes for this provider.
I think this is a nvmem core patch , isn't it ?
next prev parent reply other threads:[~2024-06-27 16:05 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
2024-06-27 14:58 ` Srinivas Kandagatla
2024-06-27 15:55 ` Marek Vasut [this message]
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=5ee8b82e-72cb-4644-889c-1959a2318d1a@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