lkml.org 
[lkml]   [2021]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] nvmem: expose NVMEM cells in sysfs
From
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.

\
 
 \ /
  Last update: 2021-12-21 16:33    [W:0.049 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site