Re: [PATCH v2 2/2] of: changesets: Introduce changeset helper methods

From: Pantelis Antoniou
Date: Mon Sep 21 2015 - 08:49:17 EST


Hi Geert,

> On Sep 21, 2015, at 15:47 , Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>
> Hi Pantelis,
>
> On Mon, Sep 21, 2015 at 2:36 PM, Pantelis Antoniou
> <pantelis.antoniou@xxxxxxxxxxxx> wrote:
>>> On Sep 21, 2015, at 15:35 , Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>>> On Wed, Sep 16, 2015 at 6:11 PM, Pantelis Antoniou
>>> <pantelis.antoniou@xxxxxxxxxxxx> wrote:
>>>> Changesets are very powerful, but the lack of a helper API
>>>> makes using them cumbersome. Introduce a simple copy based
>>>> API that makes things considerably easier.
>>>>
>>>> To wit, adding a property using the raw API.
>>>>
>>>> struct property *prop;
>>>> prop = kzalloc(sizeof(*prop)), GFP_KERNEL);
>>>> prop->name = kstrdup("compatible");
>>>> prop->value = kstrdup("foo,bar");
>>>> prop->length = strlen(prop->value) + 1;
>>>> of_changeset_add_property(ocs, np, prop);
>>>>
>>>> while using the helper API
>>>>
>>>> of_changeset_add_property_string(ocs, np, "compatible",
>>>> "foo,bar");
>>>
>>> What about removing properties?
>>
>> Once upon a time there was that capability. It was removed after we didnât have
>> a good use for them yet. Do you have any? Iâd be happy to re-add it :)
>
> Aliases?
>
> If an overlay removes e.g. a serial port, it should remove its alias, too.
>

Well, that case is handled. Addition of a property results in removal of a property when
the overlay is reverted.

This is an accessor API that makes things simpler than whatâs internally used at
overlays.

Weâre talking about removal of a property/node as part of application.

> Gr{oetje,eeting}s,
>
> Geert
>

Regards

â Pantelis

> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/