generic: 5.15: allow MV88E6xxx built-in when PTP support disabled
[openwrt/staging/svanheule.git] / target / linux / generic / hack-5.15 / 290-net-dsa-mv88e6xxx-depend-on-PTP-conditionally.patch
1 From e6866ed4219b8c7754dcd3eb1a654f6f524b0e56 Mon Sep 17 00:00:00 2001
2 From: "Johnny S. Lee" <foss@jsl.io>
3 Date: Thu, 15 Dec 2022 17:49:04 +0800
4 Subject: [PATCH] net: dsa: mv88e6xxx: depend on PTP conditionally
5
6 PTP hardware timestamping related objects are not linked when PTP
7 support for MV88E6xxx (NET_DSA_MV88E6XXX_PTP) is disabled, therefore
8 NET_DSA_MV88E6XXX should not depend on PTP_1588_CLOCK_OPTIONAL
9 regardless of NET_DSA_MV88E6XXX_PTP.
10
11 Instead, condition more strictly on how NET_DSA_MV88E6XXX_PTP's
12 dependencies are met, making sure that it cannot be enabled when
13 NET_DSA_MV88E6XXX=y and PTP_1588_CLOCK=m.
14
15 In other words, this commit allows NET_DSA_MV88E6XXX to be built-in
16 while PTP_1588_CLOCK is a module, as long as NET_DSA_MV88E6XXX_PTP is
17 prevented from being enabled.
18
19 Fixes: e5f31552674e ("ethernet: fix PTP_1588_CLOCK dependencies")
20 Signed-off-by: Johnny S. Lee <foss@jsl.io>
21 ---
22 drivers/net/dsa/mv88e6xxx/Kconfig | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
24
25 --- a/drivers/net/dsa/mv88e6xxx/Kconfig
26 +++ b/drivers/net/dsa/mv88e6xxx/Kconfig
27 @@ -2,7 +2,6 @@
28 config NET_DSA_MV88E6XXX
29 tristate "Marvell 88E6xxx Ethernet switch fabric support"
30 depends on NET_DSA
31 - depends on PTP_1588_CLOCK_OPTIONAL
32 select IRQ_DOMAIN
33 select NET_DSA_TAG_EDSA
34 select NET_DSA_TAG_DSA
35 @@ -13,7 +12,8 @@ config NET_DSA_MV88E6XXX
36 config NET_DSA_MV88E6XXX_PTP
37 bool "PTP support for Marvell 88E6xxx"
38 default n
39 - depends on NET_DSA_MV88E6XXX && PTP_1588_CLOCK
40 + depends on (NET_DSA_MV88E6XXX = y && PTP_1588_CLOCK = y) || \
41 + (NET_DSA_MV88E6XXX = m && PTP_1588_CLOCK)
42 help
43 Say Y to enable PTP hardware timestamping on Marvell 88E6xxx switch
44 chips that support it.