net: dsa: lan9303: Drop port range check
Now that ds->num_ports is 3, there is no need to check range of "port" parameter. Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7dfaa7bc99
commit
ac71a1f944
1 changed files with 4 additions and 23 deletions
|
@ -1057,17 +1057,7 @@ static int lan9303_port_enable(struct dsa_switch *ds, int port,
|
||||||
{
|
{
|
||||||
struct lan9303 *chip = ds->priv;
|
struct lan9303 *chip = ds->priv;
|
||||||
|
|
||||||
/* enable internal packet processing */
|
return lan9303_enable_processing_port(chip, port);
|
||||||
switch (port) {
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
return lan9303_enable_processing_port(chip, port);
|
|
||||||
default:
|
|
||||||
dev_dbg(chip->dev,
|
|
||||||
"Error: request to power up invalid port %d\n", port);
|
|
||||||
}
|
|
||||||
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lan9303_port_disable(struct dsa_switch *ds, int port,
|
static void lan9303_port_disable(struct dsa_switch *ds, int port,
|
||||||
|
@ -1075,18 +1065,9 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port,
|
||||||
{
|
{
|
||||||
struct lan9303 *chip = ds->priv;
|
struct lan9303 *chip = ds->priv;
|
||||||
|
|
||||||
/* disable internal packet processing */
|
lan9303_disable_processing_port(chip, port);
|
||||||
switch (port) {
|
lan9303_phy_write(ds, chip->phy_addr_sel_strap + port,
|
||||||
case 1:
|
MII_BMCR, BMCR_PDOWN);
|
||||||
case 2:
|
|
||||||
lan9303_disable_processing_port(chip, port);
|
|
||||||
lan9303_phy_write(ds, chip->phy_addr_sel_strap + port,
|
|
||||||
MII_BMCR, BMCR_PDOWN);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dev_dbg(chip->dev,
|
|
||||||
"Error: request to power down invalid port %d\n", port);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lan9303_port_bridge_join(struct dsa_switch *ds, int port,
|
static int lan9303_port_bridge_join(struct dsa_switch *ds, int port,
|
||||||
|
|
Loading…
Reference in a new issue