blob: fdfbc233aba05f3e4059a53c8ed5edc59c2db076 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
From: Roman Kuzmitskii <damex.pp@icloud.com>
Date: Sun, 01 Nov 2020 19:00:00 +0000
Subject: [PATCH] staging: octeon: sgmii to honor disabled dt node status
With this patch, sgmii interface device tree node could be disabled and
that disabled interface will not be unnecessarily initialized.
It solves the problem with Octeon boards that have 8 sgmii or more ports
initialized but have nothing connected to them.
Tested-by: Johannes Kimmel <fff@bareminimum.eu>
Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -877,8 +877,10 @@ static int cvm_oct_probe(struct platform
case CVMX_HELPER_INTERFACE_MODE_SGMII:
priv->phy_mode = PHY_INTERFACE_MODE_SGMII;
- dev->netdev_ops = &cvm_oct_sgmii_netdev_ops;
- strscpy(dev->name, "eth%d", sizeof(dev->name));
+ if (of_device_is_available(priv->of_node)) {
+ dev->netdev_ops = &cvm_oct_sgmii_netdev_ops;
+ strscpy(dev->name, "eth%d", sizeof(dev->name));
+ }
break;
case CVMX_HELPER_INTERFACE_MODE_SPI:
|