diff mbox series

[U-Boot,7/7] spi: remove define for SPI default SPEED and MODE

Message ID 1544439166-5749-8-git-send-email-patrick.delaunay@st.com
State Changes Requested
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series Remove defines for SPI default speed and mode | expand

Commit Message

Patrick DELAUNAY Dec. 10, 2018, 10:52 a.m. UTC
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 <patrick.delaunay@st.com>
---

 include/spi_flash.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Simon Goldschmidt Dec. 10, 2018, 11:26 a.m. UTC | #1
On Mon, Dec 10, 2018 at 11:53 AM Patrick Delaunay
<patrick.delaunay@st.com> 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 <patrick.delaunay@st.com>
> ---
>
>  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 <dm.h>        /* Because we dereference struct udevice here */
>  #include <linux/types.h>
>
> +#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       1000000
>  #endif
>  #ifndef CONFIG_SF_DEFAULT_MODE
>  # define CONFIG_SF_DEFAULT_MODE                SPI_MODE_3
>  #endif
> +#endif
> +
>  #ifndef CONFIG_SF_DEFAULT_CS
>  # define CONFIG_SF_DEFAULT_CS          0
>  #endif

Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

Regards,
Simon
Petr Vorel Dec. 10, 2018, 9:10 p.m. UTC | #2
Hi Patrick,

> On Mon, Dec 10, 2018 at 11:53 AM Patrick Delaunay
> <patrick.delaunay@st.com> 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 <patrick.delaunay@st.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
> > ---

> >  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 <dm.h>        /* Because we dereference struct udevice here */
> >  #include <linux/types.h>

> > +#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       1000000
> >  #endif
> >  #ifndef CONFIG_SF_DEFAULT_MODE
> >  # define CONFIG_SF_DEFAULT_MODE                SPI_MODE_3
> >  #endif
> > +#endif
Also: maybe indent preprocessor code?


Kind regards,
Petr
diff mbox series

Patch

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 <dm.h>	/* Because we dereference struct udevice here */
 #include <linux/types.h>
 
+#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	1000000
 #endif
 #ifndef CONFIG_SF_DEFAULT_MODE
 # define CONFIG_SF_DEFAULT_MODE		SPI_MODE_3
 #endif
+#endif
+
 #ifndef CONFIG_SF_DEFAULT_CS
 # define CONFIG_SF_DEFAULT_CS		0
 #endif