All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mx6sabresd: Make checkboard respect CONFIG_NXP_BOARD_REVISION
@ 2021-07-10 19:39 sbabic
  0 siblings, 0 replies; 3+ messages in thread
From: sbabic @ 2021-07-10 19:39 UTC (permalink / raw)
  To: Cody Gray, u-boot

> The default implementation of checkboard() calls the
> nxp_board_rev_string() function
> to retrieve a character representing the revision number of the board.
> However, this
> attempt to retrieve the revision number may fail in certain situations or be
> otherwise undesirable.
> There is already a configuration option to avoid retrieving the
> revision number of
> the board: CONFIG_NXP_BOARD_REVISION. In fact, if this option is enabled, the
> nxp_board_rev_string() function's definition will be omitted entirely,
> meaning that the previous implementation of checkboard() would result
> in a linker error.
> This changeset makes the default implementation of checkboard() respect the
> CONFIG_NXP_BOARD_REVISION configuration option, only attempting to retrieve
> the board revision number if that option is defined.
> Signed-off-by: Cody Gray <cody@codygray.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mx6sabresd: Make checkboard respect CONFIG_NXP_BOARD_REVISION
  2021-06-27  5:15 Cody Gray
@ 2021-06-27 12:14 ` Fabio Estevam
  0 siblings, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2021-06-27 12:14 UTC (permalink / raw)
  To: Cody Gray; +Cc: U-Boot-Denx

Hi Cody,

On Sun, Jun 27, 2021 at 2:15 AM Cody Gray <cody@codygray.com> wrote:
>
> The default implementation of checkboard() calls the
> nxp_board_rev_string() function
> to retrieve a character representing the revision number of the board.
> However, this
> attempt to retrieve the revision number may fail in certain situations or be
> otherwise undesirable.
>
> There is already a configuration option to avoid retrieving the
> revision number of
> the board: CONFIG_NXP_BOARD_REVISION. In fact, if this option is enabled, the
> nxp_board_rev_string() function's definition will be omitted entirely,
> meaning that the previous implementation of checkboard() would result
> in a linker error.
>
> This changeset makes the default implementation of checkboard() respect the
> CONFIG_NXP_BOARD_REVISION configuration option, only attempting to retrieve
> the board revision number if that option is defined.
>
> Signed-off-by: Cody Gray <cody@codygray.com>

Please fix the checkpatch warnings below and submit a v2, thanks:

WARNING: Possible unwrapped commit description (prefer a maximum 75
chars per line)
#72:
attempt to retrieve the revision number may fail in certain situations or be

WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef'
where possible
#100: FILE: board/freescale/mx6sxsabresd/mx6sxsabresd.c:323:
+#ifdef CONFIG_NXP_BOARD_REVISION

WARNING: please, no spaces at the start of a line
#103: FILE: board/freescale/mx6sxsabresd/mx6sxsabresd.c:326:
+       puts("Board: MX6SX SABRE SDB");$

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] mx6sabresd: Make checkboard respect CONFIG_NXP_BOARD_REVISION
@ 2021-06-27  5:15 Cody Gray
  2021-06-27 12:14 ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Cody Gray @ 2021-06-27  5:15 UTC (permalink / raw)
  To: u-boot; +Cc: festevam

The default implementation of checkboard() calls the
nxp_board_rev_string() function
to retrieve a character representing the revision number of the board.
However, this
attempt to retrieve the revision number may fail in certain situations or be
otherwise undesirable.

There is already a configuration option to avoid retrieving the
revision number of
the board: CONFIG_NXP_BOARD_REVISION. In fact, if this option is enabled, the
nxp_board_rev_string() function's definition will be omitted entirely,
meaning that the previous implementation of checkboard() would result
in a linker error.

This changeset makes the default implementation of checkboard() respect the
CONFIG_NXP_BOARD_REVISION configuration option, only attempting to retrieve
the board revision number if that option is defined.

Signed-off-by: Cody Gray <cody@codygray.com>
---
 board/freescale/mx6sxsabresd/mx6sxsabresd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c
b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
index 57fab23864..e5d9d1f979 100644
--- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c
+++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
@@ -320,7 +320,11 @@ int board_late_init(void)

 int checkboard(void)
 {
+#ifdef CONFIG_NXP_BOARD_REVISION
        printf("Board: MX6SX SABRE SDB rev%c\n", nxp_board_rev_string());
+#else
+       puts("Board: MX6SX SABRE SDB");
+#endif

        return 0;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-10 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-10 19:39 [PATCH] mx6sabresd: Make checkboard respect CONFIG_NXP_BOARD_REVISION sbabic
  -- strict thread matches above, loose matches on Subject: below --
2021-06-27  5:15 Cody Gray
2021-06-27 12:14 ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.