soc/intel/[tiger|cannon|meteor]lake: Fix uninitialized usb_cfg pointer

This patch addresses uninitialized usb_cfg pointer warning which is also
an error - src/soc/intel/meteorlake/fsp_params.c: error: 'usb_cfg' may
be used uninitialized in this function [-Werror=maybe-uninitialized]

BUG=None
TEST=./util/abuild/abuild for GOOGLE_HATCH, GOOGLE_VOLTEER, GOOGLE_KARIS

Change-Id: I169b6d3a979c4db78e7c0932a126d8b0a9306da7
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85026
Reviewed-by: Jon Murphy <jpmurphy@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Karthikeyan Ramasubramanian 2024-11-07 12:10:23 -07:00 committed by Jon Murphy
commit 0714d5cc8a
3 changed files with 6 additions and 6 deletions

View file

@ -531,7 +531,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
/* Enable CNVi Wifi if enabled in device tree */
#if CONFIG(SOC_INTEL_COMETLAKE)
struct device *port = NULL;
struct drivers_usb_acpi_config *usb_cfg;
struct drivers_usb_acpi_config *usb_cfg = NULL;
bool usb_audio_offload = false;
/* Search through the devicetree for matching USB devices */
@ -564,7 +564,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
if (s_cfg->CnviBtAudioOffload && !usb_audio_offload) {
printk(BIOS_WARNING, "CNVi BT Audio offload enabled but not in USB driver.\n");
}
if (!s_cfg->CnviBtAudioOffload && usb_audio_offload) {
if (!s_cfg->CnviBtAudioOffload && usb_cfg && usb_audio_offload) {
printk(BIOS_ERR, "USB BT Audio offload enabled but CNVi BT offload disabled\n");
usb_cfg->cnvi_bt_audio_offload = 0;
}

View file

@ -578,7 +578,7 @@ static void fill_fsps_cnvi_params(FSP_S_CONFIG *s_cfg,
const struct soc_intel_meteorlake_config *config)
{
struct device *port = NULL;
struct drivers_usb_acpi_config *usb_cfg;
struct drivers_usb_acpi_config *usb_cfg = NULL;
bool usb_audio_offload = false;
/* Search through the devicetree for matching USB devices */
@ -615,7 +615,7 @@ static void fill_fsps_cnvi_params(FSP_S_CONFIG *s_cfg,
if (s_cfg->CnviBtAudioOffload && !usb_audio_offload) {
printk(BIOS_WARNING, "CNVi BT Audio offload enabled but not in USB driver\n");
}
if (!s_cfg->CnviBtAudioOffload && usb_audio_offload) {
if (!s_cfg->CnviBtAudioOffload && usb_cfg && usb_audio_offload) {
printk(BIOS_ERR, "USB BT Audio offload enabled but CNVi BT offload disabled\n");
usb_cfg->cnvi_bt_audio_offload = 0;
}

View file

@ -495,7 +495,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
/* CNVi */
struct device *port = NULL;
struct drivers_usb_acpi_config *usb_cfg;
struct drivers_usb_acpi_config *usb_cfg = NULL;
bool usb_audio_offload = false;
/* Search through the devicetree for matching USB devices */
@ -528,7 +528,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
if (params->CnviBtAudioOffload && !usb_audio_offload) {
printk(BIOS_WARNING, "CNVi BT Audio offload enabled but not in USB driver.\n");
}
if (!params->CnviBtAudioOffload && usb_audio_offload) {
if (!params->CnviBtAudioOffload && usb_cfg && usb_audio_offload) {
printk(BIOS_ERR, "USB BT Audio offload enabled but CNVi BT offload disabled\n");
usb_cfg->cnvi_bt_audio_offload = 0;
}