Skip to content

Commit e90c9fc

Browse files
mwalledavem330
authored andcommitted
net: dsa: felix: allow the device to be disabled
If there is no specific configuration of the felix switch in the device tree, but only the default configuration (ie. given by the SoCs dtsi file), the probe fails because no CPU port has been set. On the other hand you cannot set a default CPU port because that depends on the actual board using the switch. [ 2.701300] DSA: tree 0 has no CPU port [ 2.705167] mscc_felix 0000:00:00.5: Failed to register DSA switch: -22 [ 2.711844] mscc_felix: probe of 0000:00:00.5 failed with error -22 Thus let the device tree disable this device entirely, like it is also done with the enetc driver of the same SoC. Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 627642f commit e90c9fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/dsa/ocelot/felix.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,11 @@ static int felix_pci_probe(struct pci_dev *pdev,
773773
struct felix *felix;
774774
int err;
775775

776+
if (pdev->dev.of_node && !of_device_is_available(pdev->dev.of_node)) {
777+
dev_info(&pdev->dev, "device is disabled, skipping\n");
778+
return -ENODEV;
779+
}
780+
776781
err = pci_enable_device(pdev);
777782
if (err) {
778783
dev_err(&pdev->dev, "device enable failed\n");

0 commit comments

Comments
 (0)