phy-core: Don't allow building phy-core as a module
PATCH 1/1 phy-core: Don't allow building phy-core as a module
include/phy/phy.h has stub code in there for when building without the phy-core enabled. This is useful for generic drivers such as ahci-platform, ehci-platoform and ohci-platform which have support for driving an optional phy passed to them through the devicetree.
Since on some boards this phy functionality is not needed, being able to disable the phy subsystem without needing a lot of #ifdef magic in the driver using it is quite useful.
However this breaks when the module using the phy subsystem is build-in and the phy-core is not, which leads to the build failing with missing symbol errors in the linking stage of the zImage.
Which leads to gems such as this being added to the Kconfig for achi_platform:
depends on GENERIC_PHY || !GENERIC_PHY
Rather then duplicating this code in a lot of places using the phy-core, I believe it is better to simply not allow the phy-core to be built as a module. The phy core is quite small and has no external dependencies, so always building it in when enabling it should not be an issue.
--- drivers/phy/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/Kconfig +1 -1
@@ -5,7 +5,7 @@ menu "PHY Subsystem" config GENERIC_PHY - tristate "PHY Core" + bool "PHY Core" help Generic PHY support.
Signature · 1 line
1.8.5.3
PATCH 1/1 phy-core: Don't allow building phy-core as a module
Quoted 13 lines · Hans de Goede
include/phy/phy.hhas stub code in there for when building without the phy-core enabled. This is useful for generic drivers such as ahci-platform, ehci-platoform and ohci-platform which have support for driving an optional phy passed to them through the devicetree.Since on some boards this phy functionality is not needed, being able to disable the phy subsystem without needing a lot of #ifdef magic in the driver using it is quite useful.
However this breaks when the module using the phy subsystem is build-in and the phy-core is not, which leads to the build failing with missing symbol errors in the linking stage of the zImage.
Quoted 8 lines
Which leads to gems such as this being added to the
Kconfigforachi_platform:depends on GENERIC_PHY || !GENERIC_PHYRather then duplicating this code in a lot of places using the phy-core, I believe it is better to simply not allow the phy-core to be built as a module. The phy core is quite small and has no external dependencies, so always building it in when enabling it should not be an issue.
Hi Hans
I ran into the same problem with sata_mv. I ended up adding a select GENERIC_PHY to force it to be built in.
So i agree with you to make it only built in.
Andrew
PATCH 1/1 phy-core: Don't allow building phy-core as a module
In reply to Hans de GoedeQuoted 15 lines · Hans de Goede
include/phy/phy.hhas stub code in there for when building without the phy-core enabled. This is useful for generic drivers such as ahci-platform, ehci-platoform and ohci-platform which have support for driving an optional phy passed to them through the devicetree.Since on some boards this phy functionality is not needed, being able to disable the phy subsystem without needing a lot of #ifdef magic in the driver using it is quite useful.
However this breaks when the module using the phy subsystem is build-in and the phy-core is not, which leads to the build failing with missing symbol errors in the linking stage of the zImage.
Which leads to gems such as this being added to the
Kconfigforachi_platform:
Quoted 8 lines
depends on GENERIC_PHY || !GENERIC_PHYRather then duplicating this code in a lot of places using the phy-core, I believe it is better to simply not allow the phy-core to be built as a module. The phy core is quite small and has no external dependencies, so always building it in when enabling it should not be an issue.
Signed-off-by Hans de Goede <[email protected]>
--
cheers,
-roger
Quoted 18 lines
--- drivers/phy/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/phy/Kconfig +1
-1@@ -5,7 +5,7 @@ menu "PHY Subsystem" config GENERIC_PHY - tristate "PHY Core" + bool "PHY Core" help Generic PHY support.