From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754458AbbIXVwK (ORCPT ); Thu, 24 Sep 2015 17:52:10 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:54406 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754037AbbIXVwI (ORCPT ); Thu, 24 Sep 2015 17:52:08 -0400 Date: Thu, 24 Sep 2015 14:52:06 -0700 (PDT) Message-Id: <20150924.145206.897667718297700953.davem@davemloft.net> To: ddaney.cavm@gmail.com Cc: linux-kernel@vger.kernel.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, devicetree@vger.kernel.org, f.fainelli@gmail.com, netdev@vger.kernel.org, david.daney@cavium.com Subject: Re: [PATCH] net: mdio-octeon: Add PCI driver binding. From: David Miller In-Reply-To: <1442968896-30776-1-git-send-email-ddaney.cavm@gmail.com> References: <1442968896-30776-1-git-send-email-ddaney.cavm@gmail.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-7 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 24 Sep 2015 14:52:07 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t8OLqGJg026090 From: David Daney Date: Tue, 22 Sep 2015 17:41:36 -0700 > From: David Daney > > When the Cavium mdio-octeon devices appear in the Thunder family of > arm64 based SoCs, they show up as PCI devices. Add PCI driver > wrapping so the driver is bound in the standard PCI device scan. > > When in this form, a single PCI device may have more than a single > bus, we call this a "nexus" of buses. The standard firmware > device_for_each_child_node() iterator is used to find the individual > buses underneath the "nexus". > > Update the device tree binding documentation for the new PCI driver > binding. > > Signed-off-by: David Daney This patch breaks the build: CC [M] drivers/net/phy/mdio-octeon.o In file included from drivers/net/phy/mdio-octeon.c:13:0: include/linux/module.h:128:27: error: redefinition of ¡__inittest¢ static inline initcall_t __inittest(void) \ ^ include/linux/device.h:1321:1: note: in expansion of macro ¡module_init¢ module_init(__driver##_init); \ ^ include/linux/pci.h:1192:2: note: in expansion of macro ¡module_driver¢ module_driver(__pci_driver, pci_register_driver, \ ^ drivers/net/phy/mdio-octeon.c:513:1: note: in expansion of macro ¡module_pci_driver¢ module_pci_driver(thunder_mdiobus_driver); ^ include/linux/module.h:128:27: note: previous definition of ¡__inittest¢ was here static inline initcall_t __inittest(void) \ ^ include/linux/device.h:1321:1: note: in expansion of macro ¡module_init¢ module_init(__driver##_init); \ ^ include/linux/platform_device.h:222:2: note: in expansion of macro ¡module_driver¢ module_driver(__platform_driver, platform_driver_register, \ ^ drivers/net/phy/mdio-octeon.c:373:1: note: in expansion of macro ¡module_platform_driver¢ module_platform_driver(octeon_mdiobus_driver); ^ include/linux/module.h:130:6: error: redefinition of ¡init_module¢ int init_module(void) __attribute__((alias(#initfn))); ^ include/linux/device.h:1321:1: note: in expansion of macro ¡module_init¢ module_init(__driver##_init); \ ^ include/linux/pci.h:1192:2: note: in expansion of macro ¡module_driver¢ module_driver(__pci_driver, pci_register_driver, \ ^ drivers/net/phy/mdio-octeon.c:513:1: note: in expansion of macro ¡module_pci_driver¢ module_pci_driver(thunder_mdiobus_driver); ^ include/linux/module.h:130:6: note: previous definition of ¡init_module¢ was here int init_module(void) __attribute__((alias(#initfn))); ^ include/linux/device.h:1321:1: note: in expansion of macro ¡module_init¢ module_init(__driver##_init); \ ^ include/linux/platform_device.h:222:2: note: in expansion of macro ¡module_driver¢ module_driver(__platform_driver, platform_driver_register, \ ^ drivers/net/phy/mdio-octeon.c:373:1: note: in expansion of macro ¡module_platform_driver¢ module_platform_driver(octeon_mdiobus_driver); ^ include/linux/module.h:134:27: error: redefinition of ¡__exittest¢ static inline exitcall_t __exittest(void) \ ^ include/linux/device.h:1326:1: note: in expansion of macro ¡module_exit¢ module_exit(__driver##_exit); ^ include/linux/pci.h:1192:2: note: in expansion of macro ¡module_driver¢ module_driver(__pci_driver, pci_register_driver, \ ^ drivers/net/phy/mdio-octeon.c:513:1: note: in expansion of macro ¡module_pci_driver¢ module_pci_driver(thunder_mdiobus_driver); ^ include/linux/module.h:134:27: note: previous definition of ¡__exittest¢ was here static inline exitcall_t __exittest(void) \ ^ include/linux/device.h:1326:1: note: in expansion of macro ¡module_exit¢ module_exit(__driver##_exit); ^ include/linux/platform_device.h:222:2: note: in expansion of macro ¡module_driver¢ module_driver(__platform_driver, platform_driver_register, \ ^ drivers/net/phy/mdio-octeon.c:373:1: note: in expansion of macro ¡module_platform_driver¢ module_platform_driver(octeon_mdiobus_driver); ^ include/linux/module.h:136:7: error: redefinition of ¡cleanup_module¢ void cleanup_module(void) __attribute__((alias(#exitfn))); ^ include/linux/device.h:1326:1: note: in expansion of macro ¡module_exit¢ module_exit(__driver##_exit); ^ include/linux/pci.h:1192:2: note: in expansion of macro ¡module_driver¢ module_driver(__pci_driver, pci_register_driver, \ ^ drivers/net/phy/mdio-octeon.c:513:1: note: in expansion of macro ¡module_pci_driver¢ module_pci_driver(thunder_mdiobus_driver); ^ include/linux/module.h:136:7: note: previous definition of ¡cleanup_module¢ was here void cleanup_module(void) __attribute__((alias(#exitfn))); ^ include/linux/device.h:1326:1: note: in expansion of macro ¡module_exit¢ module_exit(__driver##_exit); ^ include/linux/platform_device.h:222:2: note: in expansion of macro ¡module_driver¢ module_driver(__platform_driver, platform_driver_register, \ ^ drivers/net/phy/mdio-octeon.c:373:1: note: in expansion of macro ¡module_platform_driver¢ module_platform_driver(octeon_mdiobus_driver); ^ And frankly I'm not sure I like this change anyways. If the OF nodes are there, simply add code to match on those OF nodes. This is better than assuming what sits underneath a PCI node, without any checks for the 'name' or 'compatible' properties at all. That's what they are there for afterall. ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±þG«�éÿŠ{ayºʇڙë,j­¢f£¢·hš�ï�êÿ‘êçz_è®(­éšŽŠÝ¢j"�ú¶m§ÿÿ¾«þG«�éÿ¢¸?™¨è­Ú&£ø§~�á¶iO•æ¬z·švØ^¶m§ÿÿà ÿ¶ìÿ¢¸?–I¥