Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933323Ab3E1Lnz (ORCPT ); Tue, 28 May 2013 07:43:55 -0400 Received: from mail.free-electrons.com ([94.23.35.102]:56225 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932878Ab3E1Lny (ORCPT ); Tue, 28 May 2013 07:43:54 -0400 From: Alexandre Belloni To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Russell King , Shawn Guo , Sascha Hauer , Alexandre Belloni Subject: [PATCHv2 0/3] net: phy: prevent linking breakage Date: Tue, 28 May 2013 13:43:20 +0200 Message-Id: <1369741403-25315-1-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1841 Lines: 48 There is a linking issue when using phy_register_fixup{,_for_uid,_for_id} and CONFIG_PHYLIB is not a builtin: 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' This has been solved for arch/arm/mach-mxs/ and arch/arm/mach-imx/ by testing IS_BUILTIN(CONFIG_PHYLIB) before calling the functions. The first patch is an attempt at solving that issue globally. The following patches remove the unnecessary IS_BUILTIN(CONFIG_PHYLIB) checks. Quickly greping into the code shows that the issue may arise in: arch/powerpc/platforms/85xx/mpc85xx_mds.c arch/arm/mach-davinci/board-dm644x-evm.c arch/arm/mach-orion5x/dns323-setup.c arch/arm/mach-at91/board-dt-sama5.c Changes in v2: - indentation fixes - use static inline function instead of defines and return -ENOTSUPP Alexandre Belloni (3): net: phy: prevent linking breakage arm: mxs: don't check for CONFIG_PHYLIB as builtin arm: imx: don't check for CONFIG_PHYLIB as builtin arch/arm/mach-imx/mach-imx6q.c | 23 ++++++++++------------- arch/arm/mach-mxs/mach-mxs.c | 5 ++--- drivers/net/phy/phy_device.c | 6 ++++++ include/linux/phy.h | 26 ++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 16 deletions(-) -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/