Patchwork ARM: imx6q: make ksz9021rn_phy_fixup depends on config of FEC

login
register
mail settings
Submitter Richard Zhao
Date May 8, 2012, 1:21 p.m.
Message ID <1336483275-8610-1-git-send-email-richard.zhao@freescale.com>
Download mbox | patch
Permalink /patch/157680/
State New
Headers show

Comments

Richard Zhao - May 8, 2012, 1:21 p.m.
Fix build error without choose fec driver.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
---
 arch/arm/mach-imx/mach-imx6q.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Artem Bityutskiy - May 8, 2012, 1:47 p.m.
On Tue, 2012-05-08 at 21:21 +0800, Richard Zhao wrote:
> Fix build error without choose fec driver.
> 
> Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Reported-by: Artem Bityutskiy <dedekind1@gmail.com>

> +#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)

I think there is a nicer way of doing this, something like

#include <linux/kconfig.h>

if (IS_ENABLED(CONFIG_FEC)) {
}

and you do not need the #ifdef ugliness.

Patch

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index d25c5d8..999de69 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -60,6 +60,7 @@  soft:
 	soft_restart(0);
 }
 
+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)
 /* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
 static int ksz9021rn_phy_fixup(struct phy_device *phydev)
 {
@@ -74,11 +75,14 @@  static int ksz9021rn_phy_fixup(struct phy_device *phydev)
 
 	return 0;
 }
+#endif
 
 static void __init imx6q_sabrelite_init(void)
 {
+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)
 	phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
+#endif
 }
 
 static void __init imx6q_init_machine(void)