Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f7c0367 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller
Browse files

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: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c6d19ab6
Loading
Loading
Loading
Loading
+6 −10
Original line number Original line Diff line number Diff line
@@ -3590,15 +3590,13 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
	},
	},
};
};


static const struct mv88e6xxx_info *
static const struct mv88e6xxx_info *mv88e6xxx_lookup_info(unsigned int prod_num)
mv88e6xxx_lookup_info(unsigned int prod_num, const struct mv88e6xxx_info *table,
		      unsigned int num)
{
{
	int i;
	int i;


	for (i = 0; i < num; ++i)
	for (i = 0; i < ARRAY_SIZE(mv88e6xxx_table); ++i)
		if (table[i].prod_num == prod_num)
		if (mv88e6xxx_table[i].prod_num == prod_num)
			return &table[i];
			return &mv88e6xxx_table[i];


	return NULL;
	return NULL;
}
}
@@ -3625,8 +3623,7 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
	prod_num = (id & 0xfff0) >> 4;
	prod_num = (id & 0xfff0) >> 4;
	rev = id & 0x000f;
	rev = id & 0x000f;


	info = mv88e6xxx_lookup_info(prod_num, mv88e6xxx_table,
	info = mv88e6xxx_lookup_info(prod_num);
				     ARRAY_SIZE(mv88e6xxx_table));
	if (!info)
	if (!info)
		return NULL;
		return NULL;


@@ -3739,8 +3736,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
	prod_num = (id & 0xfff0) >> 4;
	prod_num = (id & 0xfff0) >> 4;
	rev = id & 0x000f;
	rev = id & 0x000f;


	ps->info = mv88e6xxx_lookup_info(prod_num, mv88e6xxx_table,
	ps->info = mv88e6xxx_lookup_info(prod_num);
					 ARRAY_SIZE(mv88e6xxx_table));
	if (!ps->info)
	if (!ps->info)
		return -ENODEV;
		return -ENODEV;