From patchwork Sat May 25 07:39:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 2613041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 7D68DDF2A2 for ; Sat, 25 May 2013 07:39:41 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ug94h-0006MN-BO; Sat, 25 May 2013 07:39:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ug94e-0005k5-Gu; Sat, 25 May 2013 07:39:32 +0000 Received: from mail.free-electrons.com ([94.23.35.102]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ug94b-0005jj-NM for linux-arm-kernel@lists.infradead.org; Sat, 25 May 2013 07:39:30 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id CAD9E4911; Sat, 25 May 2013 09:39:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (128-79-216-144.hfc.dyn.abo.bbox.fr [128.79.216.144]) by mail.free-electrons.com (Postfix) with ESMTPSA id 80DDA66E; Sat, 25 May 2013 09:39:04 +0200 (CEST) From: Alexandre Belloni To: Nicolas Ferre Subject: [PATCH v2] ARM: at91: Fix link breakage when !CONFIG_PHYLIB Date: Sat, 25 May 2013 09:39:02 +0200 Message-Id: <1369467542-25519-1-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130525_033929_886205_BD62529F X-CRM114-Status: GOOD ( 11.18 ) X-Spam-Score: -3.0 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Alexandre Belloni , Jean-Christophe Plagniol-Villard , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fixes: arch/arm/mach-at91/built-in.o: In function `ksz9021rn_phy_fixup': :(.text+0x1174): undefined reference to `mdiobus_write' :(.text+0x1188): undefined reference to `mdiobus_write' :(.text+0x119c): undefined reference to `mdiobus_write' :(.text+0x11b0): undefined reference to `mdiobus_write' arch/arm/mach-at91/built-in.o: In function `sama5_dt_device_init': :(.init.text+0x1e34): undefined reference to `phy_register_fixup_for_uid' when CONFIG_PHYLIB is not selected. Acked-by: Ludovic Desroches --- Changes in v2: use IS_BUILTIN use CONFIG_PHYLIB and not CONFIG_PHY arch/arm/mach-at91/board-dt-sama5.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c index 705305e..e9ce541 100644 --- a/arch/arm/mach-at91/board-dt-sama5.c +++ b/arch/arm/mach-at91/board-dt-sama5.c @@ -47,22 +47,24 @@ static int ksz9021rn_phy_fixup(struct phy_device *phy) #define GMII_ERCR 11 #define GMII_ERDWR 12 - /* Set delay values */ - value = GMII_RCCPSR | 0x8000; - phy_write(phy, GMII_ERCR, value); - value = 0xF2F4; - phy_write(phy, GMII_ERDWR, value); - value = GMII_RRDPSR | 0x8000; - phy_write(phy, GMII_ERCR, value); - value = 0x2222; - phy_write(phy, GMII_ERDWR, value); + if (IS_BUILTIN(CONFIG_PHYLIB)) { + /* Set delay values */ + value = GMII_RCCPSR | 0x8000; + phy_write(phy, GMII_ERCR, value); + value = 0xF2F4; + phy_write(phy, GMII_ERDWR, value); + value = GMII_RRDPSR | 0x8000; + phy_write(phy, GMII_ERCR, value); + value = 0x2222; + phy_write(phy, GMII_ERDWR, value); + } return 0; } static void __init sama5_dt_device_init(void) { - if (of_machine_is_compatible("atmel,sama5d3xcm")) + if (of_machine_is_compatible("atmel,sama5d3xcm") && IS_BUILTIN(CONFIG_PHYLIB)) phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, ksz9021rn_phy_fixup);