[OpenWrt-Devel] [PATCH 1/2] kernel: add DT binding support to AVM EVA parser

John Crispin john at phrozen.org
Mon Dec 3 01:24:51 EST 2018


On 01/12/2018 02:51, David Bauer wrote:
> It allows selecting split-firmware parser directly by
> specifying image-format in the device-tree.
>
> Signed-off-by: David Bauer <mail at david-bauer.net>
> ---
>   .../generic/files/drivers/mtd/mtdsplit/mtdsplit_eva.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_eva.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_eva.c
> index 746944ee2e..399263ccca 100644
> --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_eva.c
> +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_eva.c
> @@ -14,6 +14,7 @@
>   #include <linux/slab.h>
>   #include <linux/mtd/mtd.h>
>   #include <linux/mtd/partitions.h>
> +#include <linux/version.h>
>   #include <linux/byteorder/generic.h>
>   
>   #include "mtdsplit.h"
> @@ -79,9 +80,19 @@ static int mtdsplit_parse_eva(struct mtd_info *master,
>   	return EVA_NR_PARTS;
>   }
>   
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)

Hi,

the kernel version check is not required and can be dropped i believe

    John



> +static const struct of_device_id mtdsplit_eva_of_match_table[] = {
> +	{ .compatible = "avm,eva-firmware" },
> +	{},
> +};
> +#endif
> +
>   static struct mtd_part_parser mtdsplit_eva_parser = {
>   	.owner = THIS_MODULE,
>   	.name = "eva-fw",
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
> +	.of_match_table = mtdsplit_eva_of_match_table,
> +#endif
>   	.parse_fn = mtdsplit_parse_eva,
>   	.type = MTD_PARSER_TYPE_FIRMWARE,
>   };

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list