Thread (7 messages) 7 messages, 3 authors, 2013-11-05
STALE4598d

[PATCH] RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB

From: horms@verge.net.au (Simon Horman)
Date: 2013-11-04 23:58:29
Also in: linux-sh

On Sat, Nov 02, 2013 at 03:30:25AM +0300, Sergei Shtylyov wrote:
On 11/01/2013 03:43 AM, Simon Horman wrote:
quoted
quoted
quoted
Do not build the phy fixup unless CONFIG_PHYLIB is enabled.
Other than not being useful it is also not possible to compile
quoted
quoted
   s/compile/link/.
quoted
quoted
quoted
the code under this condition as phy_register_fixup_for_id()
is not defined.
quoted
quoted
   Not only this function is absent...
quoted
quoted
quoted
This problem was introduced by 48c8b96f21817aad
("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")
quoted
quoted
quoted
Cc: Sergei Shtylyov <redacted>
Signed-off-by: Simon Horman <redacted>
---
 arch/arm/mach-shmobile/board-lager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
quoted
quoted
quoted
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 78a31b6..d1a8ddd 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -245,7 +245,9 @@ static void __init lager_init(void)
 {
 	lager_add_standard_devices();

-	phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup);
+	if (IS_ENABLED(CONFIG_PHYLIB))
+		phy_register_fixup_for_id("r8a7790-ether-ff:01",
+					  lager_ksz8041_fixup);
quoted
quoted
   Perhaps you would consider enclosing the fixup function itself
into #ifdef as it causes link errors as well?  Doesn't seem
necessary as gcc probably drops it anyway but for completeness'
sake...
quoted
My understanding of the motivation for IS_ENABLED() is to
take advantage of gcc optimising away unused code and making such
problems disappear.
quoted
With this patch in place do you still see any warnings?
   No (but those were errors :-).
   I'd like the changelog to be adjusted at least...
Sure. Would you like me to list in the changelog the compile problems that
gcc reports without this patch? Or do you have something else in mind?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help