This series reworks how the driver determines the HW IP generation and buttress version, and how it dispatches on them.
Today ivpu_hw_ip_gen() and ivpu_hw_btrs_gen() run a switch over the PCI device ID on every call, and an unknown ID only triggers a WARN() while probe continues with an undefined generation. Patch 1 resolves both values once during device init and fails probe with -EINVAL on an unrecognized device ID. With that guarantee in place, patch 2 changes the stored values and their accessors to the real enum types and drops the default: labels from the switches that dispatch on them, so -Wswitch flags a generation that is added later but not handled. Patch 3 splits the remaining per-generation dispatch in ivpu_hw_ip_soc_cpu_boot() and pwr_island_delay_set() into helpers that return directly from each case, removing the locals that were left uninitialized on the path past the last case. No functional change is intended beyond failing probe on an unknown PCI device ID and logging the SOC CPU boot mode even when the boot fails. Andrzej Kacprowski (1): accel/ivpu: Improve HW IP gen and buttress version checks Dawid Osuchowski (1): accel/ivpu: Convert hw_ip_gen/btrs_gen to enum types Karol Wachowski (1): accel/ivpu: Split HW IP generation dispatch into helpers drivers/accel/ivpu/ivpu_drv.c | 69 +++++++++++++++++++------- drivers/accel/ivpu/ivpu_drv.h | 65 +++++++++---------------- drivers/accel/ivpu/ivpu_hw.h | 1 - drivers/accel/ivpu/ivpu_hw_ip.c | 86 ++++++++++++++++----------------- 4 files changed, 117 insertions(+), 104 deletions(-) -- 2.43.0
