177a8ce43e2763d3a926261ca1ffe72c5ac3e601
[openwrt/staging/xback.git] /
1 From 19f291d8a65cd19e7595006c7872cd95aa6f9e93 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= <alexis.lothore@bootlin.com>
3 Date: Fri, 4 Aug 2023 19:13:10 +0200
4 Subject: [PATCH 893/898] net: dsa: mv88e6xxx: pass directly chip structure to
5 mv88e6xxx_phy_is_internal
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Since this function is a simple helper, we do not need to pass a full
11 dsa_switch structure, we can directly pass the mv88e6xxx_chip structure.
12 Doing so will allow to share this function with any other function
13 not manipulating dsa_switch structure but needing info about number of
14 internal phys
15
16 Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
17 Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
18 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
19 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
20 ---
21 drivers/net/dsa/mv88e6xxx/chip.c | 6 ++----
22 1 file changed, 2 insertions(+), 4 deletions(-)
23
24 --- a/drivers/net/dsa/mv88e6xxx/chip.c
25 +++ b/drivers/net/dsa/mv88e6xxx/chip.c
26 @@ -459,10 +459,8 @@ restore_link:
27 return err;
28 }
29
30 -static int mv88e6xxx_phy_is_internal(struct dsa_switch *ds, int port)
31 +static int mv88e6xxx_phy_is_internal(struct mv88e6xxx_chip *chip, int port)
32 {
33 - struct mv88e6xxx_chip *chip = ds->priv;
34 -
35 return port < chip->info->num_internal_phys;
36 }
37
38 @@ -704,7 +702,7 @@ static void mv88e6xxx_mac_config(struct
39
40 mv88e6xxx_reg_lock(chip);
41
42 - if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(ds, port)) {
43 + if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(chip, port)) {
44 /* In inband mode, the link may come up at any time while the
45 * link is not forced down. Force the link down while we
46 * reconfigure the interface mode.