Re: [PATCH] Adding selftest testdata dynamically into live tree

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

 




On Sun, Jun 29, 2014 at 6:49 PM, Gaurav Minocha
<gaurav.minocha.os@xxxxxxxxx> wrote:
> This patch attaches selftest's device tree data (required by /drivers/of/selftest.c)
> dynamically into live device tree. First, it links selftest device tree data into the
> kernel image and then iterates over all the nodes and attaches them into the live tree.
>
> This patch will remove the manual process of addition and removal of selftest device
> tree data into the machine's dts file.
>
> Tested successfully with current selftest's testcases.

Perhaps a follow-up patch would be to remove the added nodes. I don't
think that would be dependent on the overlay support. One comment
below, otherwise:

Reviewed-by: Rob Herring <robh@xxxxxxxxxx>


>
> Signed-off-by: Gaurav Minocha <gaurav.minocha.os@xxxxxxxxx>
> ---
>  arch/arm/boot/dts/versatile-pb.dts                 |    2 -
>  drivers/of/Kconfig                                 |    3 +-
>  drivers/of/Makefile                                |    3 +-
>  drivers/of/selftest.c                              |  102 ++++++++++++++++++++
>  .../{testcases.dtsi => testcases.dts}              |    1 +
>  5 files changed, 107 insertions(+), 4 deletions(-)
>  rename drivers/of/testcase-data/{testcases.dtsi => testcases.dts} (92%)

[...]

> +/**
> + *     selftest_data_init - Reads, copies data from
> + *     linked tree and attaches it to the live tree
> + */
> +static int selftest_data_init(void)

This can be __init.

> +{
> +       int size;
> +       extern uint8_t __dtb_testcases_begin[];
> +       extern uint8_t __dtb_testcases_end[];
> +
> +       selftest_data = (void *)__dtb_testcases_begin;
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux