[PATCH 1/2] firmware: arm_scmi: uninitialized reg_io_width in shmem_setup_iomap()

From: Philip Radford

Date: Mon Nov 16 2026 - 07:32:23 EST


Replace switch by setting scmi_shmem_io_ops to use default and only
changing if reg-io-width read suceeds and has a width of 4.

Fixes: 2cd7f3db25fe ("firmware: arm_scmi: Support 'reg-io-width' property for shared memory")
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://sashiko.dev/bug/linux-dd042f6f-0b76-40b8-9435-cbc53370cd08
Signed-off-by: Philip Radford <philip.radford@xxxxxxx>
---
drivers/firmware/arm_scmi/shmem.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/firmware/arm_scmi/shmem.c b/drivers/firmware/arm_scmi/shmem.c
index dadb37557f8a..8a4557a1e5c2 100644
--- a/drivers/firmware/arm_scmi/shmem.c
+++ b/drivers/firmware/arm_scmi/shmem.c
@@ -234,16 +234,11 @@ static void __iomem *shmem_setup_iomap(struct scmi_chan_info *cinfo,
dev_err(dev, "failed to ioremap SCMI %s shared memory\n", desc);
return IOMEM_ERR_PTR(-EADDRNOTAVAIL);
}
+ *ops = &shmem_io_ops_default;

- of_property_read_u32(shmem, "reg-io-width", &reg_io_width);
- switch (reg_io_width) {
- case 4:
+ if (!of_property_read_u32(shmem, "reg-io-width", &reg_io_width) &&
+ reg_io_width == 4)
*ops = &shmem_io_ops32;
- break;
- default:
- *ops = &shmem_io_ops_default;
- break;
- }

return addr;
}
--
2.34.1