Skip to content

Commit

Permalink
net: dsa: lan9303: Drop port range check
Browse files Browse the repository at this point in the history
Now that ds->num_ports is 3, there is no need to check range of "port"
parameter.

Signed-off-by: Egil Hjelmeland <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
hjelmeland authored and davem330 committed Nov 8, 2017
1 parent 7dfaa7b commit ac71a1f
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions drivers/net/dsa/lan9303-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,36 +1057,17 @@ static int lan9303_port_enable(struct dsa_switch *ds, int port,
{
struct lan9303 *chip = ds->priv;

/* enable internal packet processing */
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;
return lan9303_enable_processing_port(chip, port);
}

static void lan9303_port_disable(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
struct lan9303 *chip = ds->priv;

/* disable internal packet processing */
switch (port) {
case 1:
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);
}
lan9303_disable_processing_port(chip, port);
lan9303_phy_write(ds, chip->phy_addr_sel_strap + port,
MII_BMCR, BMCR_PDOWN);
}

static int lan9303_port_bridge_join(struct dsa_switch *ds, int port,
Expand Down

0 comments on commit ac71a1f

Please sign in to comment.