[OpenWrt-Devel] [PATCH] kernel: modules: fix kmod-regmap

Jonas Gorski jonas.gorski at gmail.com
Fri Aug 3 15:14:34 EDT 2018


On 3 August 2018 at 18:00, Christian Lamparter <chunkeey at gmail.com> wrote:
> diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
> index dd037cf86c..7e18a21db3 100644
> --- a/package/kernel/linux/modules/other.mk
> +++ b/package/kernel/linux/modules/other.mk
> @@ -718,7 +718,7 @@ define KernelPackage/regmap
>    SUBMENU:=$(OTHER_MENU)
>    TITLE:=Generic register map support
>    DEPENDS:=+kmod-lib-lzo +kmod-i2c-core
> -  KCONFIG:=CONFIG_REGMAP=y \
> +  KCONFIG:=CONFIG_REGMAP \
>            CONFIG_REGMAP_MMIO \
>            CONFIG_REGMAP_SPI \
>            CONFIG_REGMAP_I2C \
> diff --git a/target/linux/generic/hack-4.14/259-regmap_dynamic.patch b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch
> index 1c6e78df30..458b7c35a1 100644
> --- a/target/linux/generic/hack-4.14/259-regmap_dynamic.patch
> +++ b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch
> @@ -103,7 +103,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
>   })
>
>  -#ifdef CONFIG_REGMAP
> -+#if IS_ENABLED(CONFIG_REGMAP)
> ++#if IS_REACHABLE(CONFIG_REGMAP)
>
>   enum regmap_endian {
>         /* Unspecified -> 0 -> Backwards compatible default */
> ---
>
> I think this should do just that. To quote IS_REACHABLE help text:"
> IS_REACHABLE(CONFIG_FOO) evaluates to 1 if the currently compiled
> code can call a function defined in code compiled based on CONFIG_FOO.
> This is similar to IS_ENABLED(), but returns false when invoked from
> built-in code when CONFIG_FOO is set to 'm'."
>
> and it should combine the best of both worlds. (And maybe make it
> possible to disable the REGMAP=y from ath79-tiny. Any testers?)

Ooooooh, I didn't know that one exists! Nice find! Yes, that should
fix it in a clean way without introducing more hacks.

I really like this one!


Regards
Jonas

_______________________________________________
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