From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 24 Jan 2021 10:43:29 -0700 Subject: [PATCH v3 10/12] sysinfo: Move #ifdef so that operations are always defined In-Reply-To: <20210124174331.3462226-1-sjg@chromium.org> References: <20210124174331.3462226-1-sjg@chromium.org> Message-ID: <20210124174331.3462226-3-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de At present the struct is not available unless SYSINFO is enabled. This is annoying since code it is not possible to use compile-time checks like CONFIG_IS_ENABLED(SYSINFO) with this header. Fix it by moving the #ifdef. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v2) Changes in v2: - Add new patch to fix sysinfo with CONFIG_IS_ENABLED() include/sysinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sysinfo.h b/include/sysinfo.h index c045d316b07..6e021253524 100644 --- a/include/sysinfo.h +++ b/include/sysinfo.h @@ -31,7 +31,6 @@ * to read the serial number. */ -#if CONFIG_IS_ENABLED(SYSINFO) struct sysinfo_ops { /** * detect() - Run the hardware info detection procedure for this @@ -102,6 +101,7 @@ struct sysinfo_ops { #define sysinfo_get_ops(dev) ((struct sysinfo_ops *)(dev)->driver->ops) +#if CONFIG_IS_ENABLED(SYSINFO) /** * sysinfo_detect() - Run the hardware info detection procedure for this device. * -- 2.30.0.280.ga3ce27912f-goog