netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Andrew Lunn <andrew@lunn.ch>, Andrew Lunn <andrew+netdev@lunn.ch>,
	 Russell King - ARM Linux <linux@armlinux.org.uk>,
	Jakub Kicinski <kuba@kernel.org>,
	 David Miller <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: move mdiobus_setup_mdiodev_from_board_info to mdio_bus_provider.c
Date: Tue, 20 May 2025 18:07:43 +0200	[thread overview]
Message-ID: <CAFSsGVvLr9KLFBjgs25RedKKJsHYeSw1xWLQnNddMYxUjrzLhg@mail.gmail.com> (raw)
In-Reply-To: <914ef57a-7c22-448c-b9a3-0580e5311102@redhat.com>

On Tue, May 20, 2025 at 12:45 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> On 5/15/25 10:11 PM, Heiner Kallweit wrote:
> > Move mdiobus_setup_mdiodev_from_board_info() to mdio_bus_provider.c.
> > Benefits are:
> > - The function doesn't have to be exported any longer and can be made
> >   static.
> > - We can call mdiobus_create_device() directly instead of passing it
> >   as a callback.
> >
> > Only drawback is that now list and mutex have to be exported.
>
> ... so the total exports count actually increases, and I personally
> think that exporting a function is preferable to exporting a variable.
>
Current call chain is:

__mdio_bus_register()    // in mdio_bus_provider.c (module or built-in)
  mdiobus_setup_mdiodev_from_board_info()   // in mdio-boardinfo.c (built-in)
    mdiobus_create_device()    // in mdio_bus_provider.c, currently
passed to mdiobus_setup_mdiodev_from_board_info as function pointer

Having this call chain in one source file and not having to pass
mdiobus_create_device
as a function pointer outweighs the drawback of having to export list/mutex IMO.
But as always YMMV

> @Andrew, Russell: WDYT?
>
+1

> Thanks,
>
> Paolo
>
Thanks, Heiner

  reply	other threads:[~2025-05-20 16:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 20:11 [PATCH net-next] net: phy: move mdiobus_setup_mdiodev_from_board_info to mdio_bus_provider.c Heiner Kallweit
2025-05-20 10:45 ` Paolo Abeni
2025-05-20 16:07   ` Heiner Kallweit [this message]
2025-05-25 13:46   ` Heiner Kallweit

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=CAFSsGVvLr9KLFBjgs25RedKKJsHYeSw1xWLQnNddMYxUjrzLhg@mail.gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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).