Re: [PATCH 1/5] iTCO_wdt: Expose watchdog properties using platform data

Jean Delvare
2015-07-29T07:29:41Z

Hi Matt,

On Mon, 27 Jul 2015 14:38:08 +0100, Matt Fleming wrote:
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 241fafde42cb..5336fe2ff689 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -797,7 +797,7 @@ config ITCO_WDT
> tristate "Intel TCO Timer/Watchdog"
> depends on (X86 || IA64) && PCI
> select WATCHDOG_CORE
> - select LPC_ICH
> + depends on LPC_ICH || I2C_I801
> ---help---
> Hardware driver for the intel TCO timer based watchdog devices.
> These drivers are included in the Intel 82801 I/O Controller

I don't like that. Depending on the order of the subsystems in the
Kconfig tree, the user may not see the option and has no clue that the
option exists. When he/she later enables LPC_ICH or I2C_I801, the
option becomes visible but he/she has no reason to return here to
enable it.

I can think of several ways to address the issue. One of them is to
select both drivers, as this is what most users will want anyway:

select LPC_ICH if !EXPERT
select I2C_I801 if !EXPERT

Another possibility is to make config ITCO_WDT always visible, and add
sub-options ITCO_WDT_LPC and ITCO_WDT_I2C which depend on it. Selecting
either would select the driver it depends on:

config ITCO_WDT_LPC
bool "Intel TCO Timer/Watchdog on LPC"
depends on ITCO_WDT
select LPC_ICH

config ITCO_WDT_I2C
bool "Intel TCO Timer/Watchdog on I2C"
depends on ITCO_WDT
select I2C_I801

I did not test that, some care might be needed due to tristate vs.
boolean.

I personally prefer the first approach. It may not be as clean as the
second approach but it should be good enough in practice and avoids
cluttering Kconfig with even more options.

--
Jean Delvare
SUSE L3 Support