aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/realtek-smi-core.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-10-08 23:03:40 +0200
committerJakub Kicinski <kuba@kernel.org>2020-10-10 11:25:05 -0700
commite0b2e0d8e6692ee488387aba871d0b70e1ed400a (patch)
treeb2e7ac2478de7087a1e651e09015012c806bc603 /drivers/net/dsa/realtek-smi-core.c
parentnet: phy: Move of_mdio from drivers/of to drivers/net/mdio (diff)
downloadlinux-dev-e0b2e0d8e6692ee488387aba871d0b70e1ed400a.tar.xz
linux-dev-e0b2e0d8e6692ee488387aba871d0b70e1ed400a.zip
net: dsa: rtl8366rb: Roof MTU for switch
The MTU setting for this DSA switch is global so we need to keep track of the MTU set for each port, then as soon as any MTU changes, roof the MTU to the biggest common denominator and poke that into the switch MTU setting. To achieve this we need a per-chip-variant state container for the RTL8366RB to use for the RTL8366RB-specific stuff. Other SMI switches does seem to have per-port MTU setting capabilities. Fixes: 5f4a8ef384db ("net: dsa: rtl8366rb: Support setting MTU") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/realtek-smi-core.c')
-rw-r--r--drivers/net/dsa/realtek-smi-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/dsa/realtek-smi-core.c b/drivers/net/dsa/realtek-smi-core.c
index fae188c60191..8e49d4f85d48 100644
--- a/drivers/net/dsa/realtek-smi-core.c
+++ b/drivers/net/dsa/realtek-smi-core.c
@@ -394,9 +394,10 @@ static int realtek_smi_probe(struct platform_device *pdev)
var = of_device_get_match_data(dev);
np = dev->of_node;
- smi = devm_kzalloc(dev, sizeof(*smi), GFP_KERNEL);
+ smi = devm_kzalloc(dev, sizeof(*smi) + var->chip_data_sz, GFP_KERNEL);
if (!smi)
return -ENOMEM;
+ smi->chip_data = (void *)smi + sizeof(*smi);
smi->map = devm_regmap_init(dev, NULL, smi,
&realtek_smi_mdio_regmap_config);
if (IS_ERR(smi->map)) {