[U-Boot] [PATCH 01/12] dm: spi_flash: fix wrong dependency

Simon Glass
2015-04-22T14:39:05Z

Hi,

On 22 April 2015 at 04:07, Marek Vasut <marex@denx.de> wrote:
> On Wednesday, April 22, 2015 at 11:19:53 AM, Stefan Roese wrote:
>> Hi Tom,
>>
>> On 08.04.2015 16:01, Simon Glass wrote:
>> > On 7 April 2015 at 20:50, Simon Glass <sjg@chromium.org> wrote:
>> >> On 30 March 2015 at 21:47, Masahiro Yamada
>> >>
>> >> <yamada.masahiro@socionext.com> wrote:
>> >>> CONFIG_SPI does not exist in Kconfig in the first place, so the
>> >>> dependency "depends on DM && SPI" is never met, i.e., DM_SPI_FLASH
>> >>> can never be enabled (unless you ignore the dependency in an illegal
>> >>> way. See below.)
>> >>>
>> >>> Actually, some defconfigs such as socfpga_*_defconfig define
>> >>> CONFIG_DM_SPI_FLASH=y, but it never appears in the .config file
>> >>> because of this wrong dependency.
>> >>>
>> >>> On the other hand, all the Tegra boards enable DM_SPI_FLASH because
>> >>>
>> >>> config DM_SPI_FLASH
>> >>>
>> >>> default y
>> >>>
>> >>> silently ignores the dependency.
>> >>> Unfortunately, this style of CONFIG definition is abused everywhere
>> >>> in U-Boot, so we easily miss such a wrong dependency.
>> >>>
>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> >>> ---
>> >>>
>> >>> drivers/mtd/spi/Kconfig | 2 +-
>> >>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> >>>
>> >>> diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig
>> >>> index 2dc46b4..fd2d7ac 100644
>> >>> --- a/drivers/mtd/spi/Kconfig
>> >>> +++ b/drivers/mtd/spi/Kconfig
>> >>> @@ -1,6 +1,6 @@
>> >>>
>> >>> config DM_SPI_FLASH
>> >>>
>> >>> bool "Enable Driver Model for SPI flash"
>> >>>
>> >>> - depends on DM && SPI
>> >>> + depends on DM && DM_SPI
>> >>>
>> >>> help
>> >>>
>> >>> Enable driver model for SPI flash. This SPI flash interface
>> >>> (spi_flash_probe(), spi_flash_write(), etc.) is then
>> >>>
>> >>> --
>> >>> 1.9.1
>> >>
>> >> Acked-by: Simon Glass <sjg@chromium.org>
>> >
>> > Applied to u-boot-dm/next, thanks!
>>
>> Do you plan to release a v2015.04.1 stable release at some time? Then
>> please add this patch to this version. As it fixes SPI NOR flash on
>> SoCFPGA.
>
> Maybe we should consider u-boot-stable ...

In this case, just mentioning that it was needed for the release would
have helped. It's not always obvious whether patches are important
fixes, particularly if they depend on other things.

Regards,
Simon