diff mbox

[U-Boot,1/2] x86: ich-spi: Remove useless assignment in ich_spi_xfer()

Message ID 1503800579-19321-1-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 52dd56ba847acd048205e6412e779fda991c95d3
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng Aug. 27, 2017, 2:22 a.m. UTC
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 <bmeng.cn@gmail.com>
---

 drivers/spi/ich.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Stefan Roese Aug. 27, 2017, 8 a.m. UTC | #1
On 27.08.2017 04:22, Bin Meng wrote:
> 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 <bmeng.cn@gmail.com>
> ---
> 
>   drivers/spi/ich.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
> index 373bc26..5a3d690 100644
> --- a/drivers/spi/ich.c
> +++ b/drivers/spi/ich.c
> @@ -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 */
> 

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Bin Meng Sept. 1, 2017, 9:44 a.m. UTC | #2
On Sun, Aug 27, 2017 at 4:00 PM, Stefan Roese <sr@denx.de> wrote:
> On 27.08.2017 04:22, Bin Meng wrote:
>>
>> 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 <bmeng.cn@gmail.com>
>> ---
>>
>>   drivers/spi/ich.c | 2 --
>>   1 file changed, 2 deletions(-)
>>

applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index 373bc26..5a3d690 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -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 */