spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH

Message ID 1503648771-17514-1-git-send-email-bmeng.cn@gmail.com
State New
Delegated to: Cyrille Pitchen
Headers show

Commit Message

Bin Meng Aug. 25, 2017, 8:12 a.m.
The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
data. Select it in the Kconfig.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/mtd/spi-nor/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Mika Westerberg Aug. 25, 2017, 10:40 a.m. | #1
On Fri, Aug 25, 2017 at 01:12:51AM -0700, Bin Meng wrote:
> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
> data. Select it in the Kconfig.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
> 
>  drivers/mtd/spi-nor/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
> index bfdfb1e..e998800 100644
> --- a/drivers/mtd/spi-nor/Kconfig
> +++ b/drivers/mtd/spi-nor/Kconfig
> @@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
>  	tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>  	depends on X86
>  	select SPI_INTEL_SPI
> +	select LPC_ICH

How about 

	depends on X86 && LPC_ICH

instead?
Bin Meng Aug. 25, 2017, 12:11 p.m. | #2
Hi Mika,

On Fri, Aug 25, 2017 at 6:40 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Fri, Aug 25, 2017 at 01:12:51AM -0700, Bin Meng wrote:
>> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
>> data. Select it in the Kconfig.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  drivers/mtd/spi-nor/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
>> index bfdfb1e..e998800 100644
>> --- a/drivers/mtd/spi-nor/Kconfig
>> +++ b/drivers/mtd/spi-nor/Kconfig
>> @@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
>>       tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>>       depends on X86
>>       select SPI_INTEL_SPI
>> +     select LPC_ICH
>
> How about
>
>         depends on X86 && LPC_ICH
>
> instead?

Other LPC_ICH users (like gpio, watchdog) use the 'select' logic, so I
would prefer to keep things consistent.

Regards,
Bin
Stefan Roese Aug. 25, 2017, 12:12 p.m. | #3
On 25.08.2017 12:40, Mika Westerberg wrote:
> On Fri, Aug 25, 2017 at 01:12:51AM -0700, Bin Meng wrote:
>> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
>> data. Select it in the Kconfig.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>   drivers/mtd/spi-nor/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
>> index bfdfb1e..e998800 100644
>> --- a/drivers/mtd/spi-nor/Kconfig
>> +++ b/drivers/mtd/spi-nor/Kconfig
>> @@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
>>   	tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>>   	depends on X86
>>   	select SPI_INTEL_SPI
>> +	select LPC_ICH
> 
> How about
> 
> 	depends on X86 && LPC_ICH
> 
> instead?

I prefer Bin's version, as with your patch, the MTD SPI driver will
not be "seen" / selectable, as long as the LPC_ICH support is not
enabled. I've been hunting such dependencies myself a few times and
find them unnecessary burden.

Thanks,
Stefan
Mika Westerberg Aug. 27, 2017, 2:44 p.m. | #4
On Fri, Aug 25, 2017 at 08:11:54PM +0800, Bin Meng wrote:
> Other LPC_ICH users (like gpio, watchdog) use the 'select' logic, so I
> would prefer to keep things consistent.

Fair enough.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Patch

diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
index bfdfb1e..e998800 100644
--- a/drivers/mtd/spi-nor/Kconfig
+++ b/drivers/mtd/spi-nor/Kconfig
@@ -93,6 +93,7 @@  config SPI_INTEL_SPI_PLATFORM
 	tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
 	depends on X86
 	select SPI_INTEL_SPI
+	select LPC_ICH
 	help
 	  This enables platform support for the Intel PCH/PCU SPI
 	  controller in master mode. This controller is present in modern