Skip to content

Commit ac71a1f

Browse files
hjelmelanddavem330
authored andcommitted
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>
1 parent 7dfaa7b commit ac71a1f

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

drivers/net/dsa/lan9303-core.c

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,36 +1057,17 @@ static int lan9303_port_enable(struct dsa_switch *ds, int port,
10571057
{
10581058
struct lan9303 *chip = ds->priv;
10591059

1060-
/* enable internal packet processing */
1061-
switch (port) {
1062-
case 1:
1063-
case 2:
1064-
return lan9303_enable_processing_port(chip, port);
1065-
default:
1066-
dev_dbg(chip->dev,
1067-
"Error: request to power up invalid port %d\n", port);
1068-
}
1069-
1070-
return -ENODEV;
1060+
return lan9303_enable_processing_port(chip, port);
10711061
}
10721062

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

1078-
/* disable internal packet processing */
1079-
switch (port) {
1080-
case 1:
1081-
case 2:
1082-
lan9303_disable_processing_port(chip, port);
1083-
lan9303_phy_write(ds, chip->phy_addr_sel_strap + port,
1084-
MII_BMCR, BMCR_PDOWN);
1085-
break;
1086-
default:
1087-
dev_dbg(chip->dev,
1088-
"Error: request to power down invalid port %d\n", port);
1089-
}
1068+
lan9303_disable_processing_port(chip, port);
1069+
lan9303_phy_write(ds, chip->phy_addr_sel_strap + port,
1070+
MII_BMCR, BMCR_PDOWN);
10901071
}
10911072

10921073
static int lan9303_port_bridge_join(struct dsa_switch *ds, int port,

0 commit comments

Comments
 (0)