summaryrefslogtreecommitdiff
path: root/drivers/spi/bfin_spi6xx.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-12-02 12:57:44 +0800
committerSonic Zhang <sonic.zhang@analog.com>2013-12-06 16:06:51 +0800
commit9bac8f77698771165def23b9eebad536d5b5cd6d (patch)
treef035cb652dbbd992bf0dd97389980998e966228a /drivers/spi/bfin_spi6xx.c
parent727cbe14b25b492bc9b96ad9d1f5f881d833028e (diff)
downloadu-boot-imx-9bac8f77698771165def23b9eebad536d5b5cd6d.zip
u-boot-imx-9bac8f77698771165def23b9eebad536d5b5cd6d.tar.gz
u-boot-imx-9bac8f77698771165def23b9eebad536d5b5cd6d.tar.bz2
spi: bfin_spi6xx: Remove unnecessary test for bus and pins[bus]
For invalid bus number, current code returns NULL in the default case of switch-case statements. In additional, pins[bus] is always not NULL because it is the address of specific row of the two-dimensional array. Thus this patch removes these unnecessary test. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Diffstat (limited to 'drivers/spi/bfin_spi6xx.c')
-rw-r--r--drivers/spi/bfin_spi6xx.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/spi/bfin_spi6xx.c b/drivers/spi/bfin_spi6xx.c
index c25c4a9..07b833d 100644
--- a/drivers/spi/bfin_spi6xx.c
+++ b/drivers/spi/bfin_spi6xx.c
@@ -154,10 +154,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
if (!spi_cs_is_valid(bus, cs))
return NULL;
- if (bus >= ARRAY_SIZE(pins) || pins[bus] == NULL) {
- debug("%s: invalid bus %u\n", __func__, bus);
- return NULL;
- }
switch (bus) {
#ifdef SPI0_REGBASE
case 0:
@@ -175,6 +171,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
break;
#endif
default:
+ debug("%s: invalid bus %u\n", __func__, bus);
return NULL;
}