aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2016-06-20 13:14:04 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-21 03:58:29 -0400
commit5f7c036719536362f293c03c951f36a0509e7aec (patch)
tree619747bd9428ebdba22b5515de2fee75426b0890 /drivers/net/dsa/mv88e6xxx.c
parentnet: dsa: mv88e6xxx: use gpio get optional variant (diff)
downloadlinux-dev-5f7c036719536362f293c03c951f36a0509e7aec.tar.xz
linux-dev-5f7c036719536362f293c03c951f36a0509e7aec.zip
net: dsa: mv88e6xxx: remove table args in info lookup
The mv88e6xxx_table array and the mv88e6xxx_lookup_info function are static, so remove the table and size arguments from the lookup function. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/dsa/mv88e6xxx.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index ec28465ee323..75e540881077 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -3590,15 +3590,13 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
},
};
-static const struct mv88e6xxx_info *
-mv88e6xxx_lookup_info(unsigned int prod_num, const struct mv88e6xxx_info *table,
- unsigned int num)
+static const struct mv88e6xxx_info *mv88e6xxx_lookup_info(unsigned int prod_num)
{
int i;
- for (i = 0; i < num; ++i)
- if (table[i].prod_num == prod_num)
- return &table[i];
+ for (i = 0; i < ARRAY_SIZE(mv88e6xxx_table); ++i)
+ if (mv88e6xxx_table[i].prod_num == prod_num)
+ return &mv88e6xxx_table[i];
return NULL;
}
@@ -3625,8 +3623,7 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
prod_num = (id & 0xfff0) >> 4;
rev = id & 0x000f;
- info = mv88e6xxx_lookup_info(prod_num, mv88e6xxx_table,
- ARRAY_SIZE(mv88e6xxx_table));
+ info = mv88e6xxx_lookup_info(prod_num);
if (!info)
return NULL;
@@ -3739,8 +3736,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
prod_num = (id & 0xfff0) >> 4;
rev = id & 0x000f;
- ps->info = mv88e6xxx_lookup_info(prod_num, mv88e6xxx_table,
- ARRAY_SIZE(mv88e6xxx_table));
+ ps->info = mv88e6xxx_lookup_info(prod_num);
if (!ps->info)
return -ENODEV;