Patchwork [U-Boot] AT91: remove superfluous test in spi driver

login
register
mail settings
Submitter Reinhard Meyer (-VC)
Date July 30, 2010, 9:53 a.m.
Message ID <4C52A125.3090001@emk-elektronik.de>
Download mbox | patch
Permalink /patch/71799/
State Accepted
Delegated to: Reinhard Meyer
Headers show

Comments

Reinhard Meyer (-VC) - July 30, 2010, 9:53 a.m.
Let spi_cs_is_valid() alone make the decision

Signed-off-by: Reinhard Meyer <info@emk-elektronik.de>
---
 drivers/spi/atmel_spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Xu, Hong - Aug. 9, 2010, 9:34 a.m.
Hi Reinhard Meyer,

> -----Original Message-----
> From: u-boot-bounces@lists.denx.de 
> [mailto:u-boot-bounces@lists.denx.de] On Behalf Of Reinhard 
> Meyer (-VC)
> Sent: 2010?7?30? 17:54
> To: u-boot
> Subject: [U-Boot] [PATCH] AT91: remove superfluous test in spi driver
> 
> Let spi_cs_is_valid() alone make the decision
> 
> Signed-off-by: Reinhard Meyer <info@emk-elektronik.de>

Acked-By: Hong Xu <hong.xu@atmel.com>

BR,
Eric

>  drivers/spi/atmel_spi.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/spi/atmel_spi.c 
> b/drivers/spi/atmel_spi.c index 317c0b4..1a650ee 100644
> --- a/drivers/spi/atmel_spi.c
> +++ b/drivers/spi/atmel_spi.c
[...]

Patch

diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 317c0b4..1a650ee 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -43,7 +43,7 @@  struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 	u32			csrx;
 	void			*regs;
 
-	if (cs > 3 || !spi_cs_is_valid(bus, cs))
+	if (!spi_cs_is_valid(bus, cs))
 		return NULL;
 
 	switch (bus) {