ARM: davinci: make dm644x-evm phy fixup conditional
authorArnd Bergmann <arnd@arndb.de>
Thu, 13 Mar 2014 16:50:35 +0000 (17:50 +0100)
committerArnd Bergmann <arnd@arndb.de>
Fri, 21 Mar 2014 17:19:32 +0000 (18:19 +0100)
We cannot call phy_register_fixup_for_uid() if CONFIG_PHYLIB
is not built into the kernel, and we should not enforce that
to be built into vmlinux either, because one might want to
disable the entire network stack.

This change uses a compile-time condition on CONFIG_PHYLIB
to remove the call in the cases where it cannot work.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: davinci-linux-open-source@linux.davincidsp.com
arch/arm/mach-davinci/board-dm644x-evm.c

index 987605b78556f9e8fa16b1e9b1b278ad0abe4d1c..3de4dc9a16985144383504d6c062b475ff1cfc6a 100644 (file)
@@ -799,11 +799,12 @@ static __init void davinci_evm_init(void)
        /* irlml6401 switches over 1A, in under 8 msec */
        davinci_setup_usb(1000, 8);
 
-       soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID;
-       /* Register the fixup for PHY on DaVinci */
-       phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
-                                       davinci_phy_fixup);
-
+       if (IS_BUILTIN(CONFIG_PHYLIB)) {
+               soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID;
+               /* Register the fixup for PHY on DaVinci */
+               phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
+                                               davinci_phy_fixup);
+       }
 }
 
 MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")