mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: ec/lenovo: Add guards to fix build errors without SMBIOS
Not selecting the Kconfig option `GENERATE_SMBIOS_TABLES` the build
fails with the error below.
```
CC ramstage/ec/lenovo/h8/h8.o
src/ec/lenovo/h8/h8.c:201:2: error: unknown field 'get_smbios_strings' specified in initializer
.get_smbios_strings = h8_smbios_strings,
^
src/ec/lenovo/h8/h8.c:201:2: error: initialization from incompatible pointer type [-Werror]
src/ec/lenovo/h8/h8.c:201:2: error: (near initialization for 'h8_dev_ops.read_resources') [-Werror]
cc1: all warnings being treated as errors
```
So add the appropriate preprocessor guards to fix the build error.
BUG=none
BRANCH=none
TEST=none
Change-Id: I8d29e84c4664871193e0ca6e40ea22554caea1ad
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 2a4a452abc
Original-Change-Id: I3baed452d422539a805c628a8c4a6a8c2a809317
Original-Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-on: https://review.coreboot.org/17770
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://chromium-review.googlesource.com/445154
This commit is contained in:
parent
ff4d234494
commit
169e9c120c
1 changed files with 4 additions and 0 deletions
|
@ -182,6 +182,7 @@ u8 h8_build_id_and_function_spec_version(char *buf, u8 buf_len)
|
|||
return i;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES)
|
||||
static void h8_smbios_strings(struct device *dev, struct smbios_type11 *t)
|
||||
{
|
||||
char tpec[] = "IBM ThinkPad Embedded Controller -[ ]-";
|
||||
|
@ -190,6 +191,7 @@ static void h8_smbios_strings(struct device *dev, struct smbios_type11 *t)
|
|||
|
||||
t->count = smbios_add_string(t->eos, tpec);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void h8_init(device_t dev)
|
||||
{
|
||||
|
@ -197,7 +199,9 @@ static void h8_init(device_t dev)
|
|||
}
|
||||
|
||||
struct device_operations h8_dev_ops = {
|
||||
#if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES)
|
||||
.get_smbios_strings = h8_smbios_strings,
|
||||
#endif
|
||||
.init = h8_init,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue