Re: [PATCH v2] Support conditional deps using "depends on X if Y"

From: Jani Nikula

Date: Fri Dec 05 2025 - 04:07:07 EST


On Tue, 18 Nov 2025, Graham Roff <grahamr@xxxxxxxxxxxxxxxx> wrote:
> @@ -602,8 +612,14 @@ Some drivers are able to optionally use a feature from another module
> or build cleanly with that module disabled, but cause a link failure
> when trying to use that loadable module from a built-in driver.
>
> -The most common way to express this optional dependency in Kconfig logic
> -uses the slightly counterintuitive::
> +The recommended way to express this optional dependency in Kconfig logic
> +uses the conditional form::
> +
> + config FOO
> + tristate "Support for foo hardware"
> + depends on BAR if BAR
> +
> +This slightly counterintuitive style is also widely used::
>
> config FOO
> tristate "Support for foo hardware"

Thanks for adding this documentation hunk.


BR,
Jani.


--
Jani Nikula, Intel