x86: ich-spi: Remove useless assignment in ich_spi_xfer()
PATCH 1/2 x86: ich-spi: Remove useless assignment in ich_spi_xfer()
In ich_spi_xfer() when the driver presets control fields, control variable gets assigned twice. Apparently only the last assignment takes effect. Remove the other one.
---
drivers/spi/ich.c | 2 -- 1 file changed, 2 deletions(-)
drivers/spi/ich.c +0 -2
@@ -468,8 +468,6 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen, }/* Preset control fields */ - control =ich_readw (ctlr, ctlr->control); - control &= ~SSFC_RESERVED ; control =SPIC_SCGO | ((opcode_index &0x07 ) <<4 );/* Issue atomic preop cycle if needed */
Signature · 1 line
2.9.2
PATCH 2/2 x86: ich-spi: Clear atomic preop only when SPI settings are not locked
The atomic preop register can only be written when SPI settings are not locked, otherwise it's read-only.
---
drivers/spi/ich.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/ich.c +2 -1
@@ -563,7 +563,8 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen, }/* Clear atomic preop now that xfer is done */ -ich_writew (ctlr,0 , ctlr->preop); +if (!lock) +ich_writew (ctlr,0 , ctlr->preop);return 0 ; }
Signature · 1 line
2.9.2
PATCH 2/2 x86: ich-spi: Clear atomic preop only when SPI settings are not locked
Quoted 15 lines · Bin Meng
The atomic preop register can only be written when SPI settings are not locked, otherwise it's read-only.
Signed-off-by Bin Meng <[email protected]>---
drivers/spi/ich.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/spi/ich.c +0
-0
drivers/spi/ich.c static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen, · line 570
Quoted 9 lines
drivers/spi/ich.c +2
-1@@ -563,7 +563,8 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen, }/* Clear atomic preop now that xfer is done */ -ich_writew (ctlr,0 , ctlr->preop); +if (!lock) +ich_writew (ctlr,0 , ctlr->preop);return 0 ; }
Thanks,
Stefan
PATCH 2/2 x86: ich-spi: Clear atomic preop only when SPI settings are not locked
Quoted 11 lines · Stefan Roese
Quoted 10 lines · Bin Meng
The atomic preop register can only be written when SPI settings are not locked, otherwise it's read-only.
Signed-off-by Bin Meng <[email protected]>---
drivers/spi/ich.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
applied to u-boot-x86, thanks!
PATCH 1/2 x86: ich-spi: Remove useless assignment in ich_spi_xfer()
In reply to Bin MengQuoted 16 lines · Bin Meng
In
ich_spi_xfer()when the driver presets control fields, control variable gets assigned twice. Apparently only the last assignment takes effect. Remove the other one.Signed-off-by Bin Meng <[email protected]>---
drivers/spi/ich.c | 2 -- 1 file changed, 2 deletions(-)drivers/spi/ich.c +0
-0
drivers/spi/ich.c static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen, · line 473
Quoted 8 lines
drivers/spi/ich.c +0
-2@@ -468,8 +468,6 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen, }/* Preset control fields */ - control =ich_readw (ctlr, ctlr->control); - control &= ~SSFC_RESERVED ; control =SPIC_SCGO | ((opcode_index &0x07 ) <<4 );/* Issue atomic preop cycle if needed */
Thanks,
Stefan
PATCH 1/2 x86: ich-spi: Remove useless assignment in ich_spi_xfer()
Quoted 6 lines · Stefan Roese
Quoted 5 lines · Bin Meng
In
ich_spi_xfer()when the driver presets control fields, control variable gets assigned twice. Apparently only the last assignment takes effect. Remove the other one.
Quoted 6 lines
Quoted 6 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/spi/ich.c | 2 -- 1 file changed, 2 deletions(-)
applied to u-boot-x86, thanks!