[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6167555-6425-4457-254d-8cba61153b1a@gmail.com>
Date: Tue, 21 Dec 2021 16:33:18 +0100
From: Rafał Miłecki <zajec5@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Jonathan Corbet <corbet@....net>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Dan Williams <dan.j.williams@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Krzysztof Wilczyński <kw@...ux.com>,
Heiner Kallweit <hkallweit1@...il.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
Rafał Miłecki <rafal@...ecki.pl>
Subject: Re: [PATCH 2/2] nvmem: expose NVMEM cells in sysfs
On 21.12.2021 16:18, Greg Kroah-Hartman wrote:
> On Tue, Dec 21, 2021 at 04:09:13PM +0100, Rafał Miłecki wrote:
>> So both: kernel and user space need to access U-Boot environment
>> variables (NVMEM cells). Each for its own purposes.
>>
>> Kernel goes first so it needs its own parser of NVMEM content (data).
>>
>> User space can either: get NVMEM cells exposed by kernel OR parse NVMEM
>> content on its own. I thought it'd be nice to avoid parsing code
>> duplication in user space and let kernel expose NVMEM cells.
>
> Ah, so you already have the data parsed, and you just want to also
> expose it to userspace. That makes more sense (sorry, it's been a long
> day of reviewing crappy patches, not yours of course...)
>
> So sure, you can dynamically create attributes and then add them to the
> device before you register it with the driver core. Be sure to
> initialize them properly with the call I pointed out previously and you
> should be good to go. You will have to keep a list of them around and
> then free them yourself when the device is cleaned up, so watch out for
> that.
>
> And again, don't use a binary attribute, that's not what it is for.
Thanks for review & discussing this! I really appreciate you getting
this patch details out of me so it's clear how to proceed.
Lesson learnt: spend more time on describing my commits.
Powered by blists - more mailing lists