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: 059f545832 ("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>
This commit is contained in:
Dan Carpenter 2025-11-24 10:56:01 +03:00 • committed by Mark Brown
commit cb99656b7c
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0