devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
To: ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH] net: mdio-octeon: Add PCI driver binding.
Date: Thu, 24 Sep 2015 14:52:06 -0700 (PDT)	[thread overview]
Message-ID: <20150924.145206.897667718297700953.davem@davemloft.net> (raw)
In-Reply-To: <1442968896-30776-1-git-send-email-ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

From: David Daney <ddaney.cavm@gmail.com>
Date: Tue, 22 Sep 2015 17:41:36 -0700

> From: David Daney <david.daney@cavium.com>
> 
> 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 <david.daney@cavium.com>

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.


  parent reply	other threads:[~2015-09-24 21:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23  0:41 [PATCH] net: mdio-octeon: Add PCI driver binding David Daney
     [not found] ` <1442968896-30776-1-git-send-email-ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-24 21:52   ` David Miller [this message]
2015-09-24 22:04     ` David Daney
     [not found]       ` <56047367.3060101-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2015-09-24 22:12         ` David Daney
2015-09-24 22:16           ` David Miller
2015-09-24 22:14       ` David Miller
     [not found]         ` <20150924.151451.1059470233561232912.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-09-24 22:45           ` David Daney
2015-09-24 22:50             ` David Miller
2015-09-24 22:54               ` David Daney
2015-09-24 23:07                 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150924.145206.897667718297700953.davem@davemloft.net \
    --to=davem-ft/pcqaiutieiz0/mpfg9q@public.gmane.org \
    --cc=david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).