Re: [PATCH 4/7] misc: Add a driver to expose U-Boot environment variable data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 28, 2019 at 06:19:51PM -0700, Andrey Smirnov wrote:
> On Tue, May 28, 2019 at 2:34 AM Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> wrote:
> >
> > On Mon, May 27, 2019 at 01:18:50PM -0700, Andrey Smirnov wrote:
> > > Add a driver to expose U-Boot environment variable data as a single
> > > mmap-able device. Not very useful on its own, it is a crucial
> > > low-level plumbing needed by filesystem driver introduced in the
> > > following commit.
> >
> > It wasn't clear to me why we need this driver at all, so it might be
> > worth adding a comment that this is for handling redundant env.
> >
> 
> Was it before of after you read the Kconfig help that talks about it?
> Asking to see if copying that text into commit would be enough, or if
> should write a more detailed explanation.

It was before I had read the Kconfig text. Indeed the Kconfig text makes
it clear.

> > > +      */
> > > +     ubdata->current = !ubdata->current;
> > > +
> > > +close_fd:
> > > +     close(fd);
> > > +     return ret;
> > > +}
> > > +
> > > +static struct cdev_operations ubootvar_ops = {
> > > +     .read = mem_read,
> > > +     .write = mem_write,
> > > +     .memmap = generic_memmap_rw,
> >
> > Ok, now I understand this struct resource thingy, you want to reuse
> > mem_read and friends. Given that these functions are oneliners to
> > implement I still suggest implementing them.
> >
> 
> OK, I'll have to make mem_copy() visible globally for them to remain
> one-liners, but that should be doable.

You won't need mem_copy(), plain memcpy() is enough. mem_copy() is only for
accessing registers in with the correct width, but that doesn't matter
here.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux