Commit 377d66f
net: dsa: lantiq_gswip: fix order in .remove operation
Russell King pointed out that disabling the switch by clearing
GSWIP_MDIO_GLOB_ENABLE before calling dsa_unregister_switch() is
problematic, as it violates a Golden Rule of driver development to
always first unpublish userspace interfaces and then disable the
hardware.
Fix this, and also simplify the probe() function, by introducing a
dsa_switch_ops teardown() operation which takes care of clearing the
GSWIP_MDIO_GLOB_ENABLE bit.
Fixes: 14fceff ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Suggested-by: "Russell King (Oracle)" <linux@armlinux.org.uk>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://patch.msgid.link/4ebd72a29edc1e4059b9666a26a0bb5d906a829a.1765241054.git.daniel@makrotopia.org
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent 7b07be1 commit 377d66f
2 files changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | 447 | | |
451 | 448 | | |
452 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
755 | 762 | | |
756 | 763 | | |
757 | 764 | | |
| |||
1629 | 1636 | | |
1630 | 1637 | | |
1631 | 1638 | | |
| 1639 | + | |
1632 | 1640 | | |
1633 | 1641 | | |
1634 | 1642 | | |
| |||
1718 | 1726 | | |
1719 | 1727 | | |
1720 | 1728 | | |
1721 | | - | |
| 1729 | + | |
1722 | 1730 | | |
1723 | 1731 | | |
1724 | 1732 | | |
1725 | 1733 | | |
1726 | 1734 | | |
1727 | 1735 | | |
1728 | | - | |
1729 | | - | |
| 1736 | + | |
1730 | 1737 | | |
1731 | 1738 | | |
1732 | 1739 | | |
| |||
0 commit comments