spi: Fix potential uninitialized variable in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 24 Nov 2025 07:56:01 +0000 (10:56 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 24 Nov 2025 15:11:55 +0000 (15:11 +0000)
commitcb99656b7c4185953c9d272bbdab63c8aa651e6e
treeb4bad90771cb12c306757682a5335039e6c93a53
parent43a3adb6dd39d98bf84e04569e7604be5e5c0d79
spi: Fix potential uninitialized variable in probe()

If the device tree is messed up, then potentially the "protocol" string
could potentially be uninitialized.  The property is supposed to default
to "motorola" so if the of_property_read_string() function returns
-EINVAL then default to "motorola".

Fixes: 059f545832be ("spi: add support for microchip "soft" spi controller")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com>
Link: https://patch.msgid.link/aSQPkfkiJ0w-FJMW@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-microchip-core-spi.c