Re: [U-Boot] [PATCH 7/7] spi: remove define for SPI default SPEED and MODE
Hi Patrick, > On Mon, Dec 10, 2018 at 11:53 AM Patrick Delaunay > wrote: > > In DM mode, the speed and mode defaults value will be taken from DT, > > so these defines should be never used and can be removed. > > Signed-off-by: Patrick Delaunay Reviewed-by: Petr Vorel > > --- > > include/spi_flash.h | 4 > > 1 file changed, 4 insertions(+) > > diff --git a/include/spi_flash.h b/include/spi_flash.h > > index 36565bb..c9d20a5 100644 > > --- a/include/spi_flash.h > > +++ b/include/spi_flash.h > > @@ -12,12 +12,16 @@ > > #include /* Because we dereference struct udevice here */ > > #include > > +#ifndef CONFIG_DM_SPI_FLASH > > +/* In DM mode, speed and mode value will be taken from DT */ > > #ifndef CONFIG_SF_DEFAULT_SPEED > > # define CONFIG_SF_DEFAULT_SPEED 100 > > #endif > > #ifndef CONFIG_SF_DEFAULT_MODE > > # define CONFIG_SF_DEFAULT_MODESPI_MODE_3 > > #endif > > +#endif Also: maybe indent preprocessor code? Kind regards, Petr ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 7/7] spi: remove define for SPI default SPEED and MODE
On Mon, Dec 10, 2018 at 11:53 AM Patrick Delaunay wrote: > > In DM mode, the speed and mode defaults value will be taken from DT, > so these defines should be never used and can be removed. > > Signed-off-by: Patrick Delaunay > --- > > include/spi_flash.h | 4 > 1 file changed, 4 insertions(+) > > diff --git a/include/spi_flash.h b/include/spi_flash.h > index 36565bb..c9d20a5 100644 > --- a/include/spi_flash.h > +++ b/include/spi_flash.h > @@ -12,12 +12,16 @@ > #include /* Because we dereference struct udevice here */ > #include > > +#ifndef CONFIG_DM_SPI_FLASH > +/* In DM mode, speed and mode value will be taken from DT */ > #ifndef CONFIG_SF_DEFAULT_SPEED > # define CONFIG_SF_DEFAULT_SPEED 100 > #endif > #ifndef CONFIG_SF_DEFAULT_MODE > # define CONFIG_SF_DEFAULT_MODESPI_MODE_3 > #endif > +#endif > + > #ifndef CONFIG_SF_DEFAULT_CS > # define CONFIG_SF_DEFAULT_CS 0 > #endif Reviewed-by: Simon Goldschmidt Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 7/7] spi: remove define for SPI default SPEED and MODE
In DM mode, the speed and mode defaults value will be taken from DT, so these defines should be never used and can be removed. Signed-off-by: Patrick Delaunay --- include/spi_flash.h | 4 1 file changed, 4 insertions(+) diff --git a/include/spi_flash.h b/include/spi_flash.h index 36565bb..c9d20a5 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -12,12 +12,16 @@ #include /* Because we dereference struct udevice here */ #include +#ifndef CONFIG_DM_SPI_FLASH +/* In DM mode, speed and mode value will be taken from DT */ #ifndef CONFIG_SF_DEFAULT_SPEED # define CONFIG_SF_DEFAULT_SPEED 100 #endif #ifndef CONFIG_SF_DEFAULT_MODE # define CONFIG_SF_DEFAULT_MODESPI_MODE_3 #endif +#endif + #ifndef CONFIG_SF_DEFAULT_CS # define CONFIG_SF_DEFAULT_CS 0 #endif -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot