spi: amlogic: Fix error checking on regmap_write call
Subsystems (4)
PATCH 1/1 spi: amlogic: Fix error checking on regmap_write call
Currently a call to regmap_write is not being error checked because the return checke is being performed on the variable ret and this variable is not assigned the return value from the regmap_write call. Fix this by adding in the missing assignment.
Fixes 4670db6f32e9 ("spi: amlogic: add driver for Amlogic SPI Flash Controller")
Signed-off-by Colin Ian King <[email protected]>
--- drivers/spi/spi-amlogic-spifc-a4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-amlogic-spifc-a4.c +1 -1
@@ -420,7 +420,7 @@ static int aml_sfc_dma_buffer_setup(struct aml_sfc *sfc, void *databuf, goto out_map_data; cmd =CMD_DATA_ADDRH (sfc->daddr); -regmap_write (sfc->regmap_base,SFC_CMD , cmd); + ret =regmap_write (sfc->regmap_base,SFC_CMD , cmd);if (ret) goto out_map_data;
Signature · 1 line
2.51.0
Reviewed-by Xianwei Zhao <[email protected]>
Quoted 31 lines · Colin Ian King
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
[ EXTERNAL EMAIL ]
Currently a call to
regmap_writeis not being error checked because the return checke is being performed on the variable ret and this variable is not assigned the return value from theregmap_writecall. Fix this by adding in the missing assignment.Fixes 4670db6f32e9 ("spi: amlogic: add driver for Amlogic SPI Flash Controller")Signed-off-by Colin Ian King <[email protected]>--- drivers/spi/spi-amlogic-spifc-a4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/spi/spi-amlogic-spifc-a4.c +1
-2@@ -420,7 +420,7 @@ static int aml_sfc_dma_buffer_setup(struct aml_sfc *sfc, void *databuf, goto out_map_data; cmd =CMD_DATA_ADDRH (sfc->daddr); -regmap_write (sfc->regmap_base,SFC_CMD , cmd); + ret =regmap_write (sfc->regmap_base,SFC_CMD , cmd);if (ret) goto out_map_data; --2.51.0