All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register
@ 2021-05-18 17:49 Vladimir Oltean
  2021-05-18 17:51 ` Florian Fainelli
  2021-05-18 21:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Vladimir Oltean @ 2021-05-18 17:49 UTC (permalink / raw)
  To: Jakub Kicinski, David S. Miller, netdev
  Cc: Florian Fainelli, Stephen Rothwell, Ansuel Smith, John Crispin,
	Rob Herring, Frank Rowand, Andrew Lunn, Heiner Kallweit,
	Russell King, Randy Dunlap

Similar to the way in which of_mdiobus_register() has a fallback to the
non-DT based mdiobus_register() when CONFIG_OF is not set, we can create
a shim for the device-managed devm_of_mdiobus_register() which calls
devm_mdiobus_register() and discards the struct device_node *.

In particular, this solves a build issue with the qca8k DSA driver which
uses devm_of_mdiobus_register and can be compiled without CONFIG_OF.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 include/linux/of_mdio.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 2b05e7f7c238..da633d34ab86 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -72,6 +72,13 @@ static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *
 	return mdiobus_register(mdio);
 }
 
+static inline int devm_of_mdiobus_register(struct device *dev,
+					   struct mii_bus *mdio,
+					   struct device_node *np)
+{
+	return devm_mdiobus_register(dev, mdio);
+}
+
 static inline struct mdio_device *of_mdio_find_device(struct device_node *np)
 {
 	return NULL;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register
  2021-05-18 17:49 [PATCH net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register Vladimir Oltean
@ 2021-05-18 17:51 ` Florian Fainelli
  2021-05-18 21:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2021-05-18 17:51 UTC (permalink / raw)
  To: Vladimir Oltean, Jakub Kicinski, David S. Miller, netdev
  Cc: Stephen Rothwell, Ansuel Smith, John Crispin, Rob Herring,
	Frank Rowand, Andrew Lunn, Heiner Kallweit, Russell King,
	Randy Dunlap



On 5/18/2021 10:49 AM, Vladimir Oltean wrote:
> Similar to the way in which of_mdiobus_register() has a fallback to the
> non-DT based mdiobus_register() when CONFIG_OF is not set, we can create
> a shim for the device-managed devm_of_mdiobus_register() which calls
> devm_mdiobus_register() and discards the struct device_node *.
> 
> In particular, this solves a build issue with the qca8k DSA driver which
> uses devm_of_mdiobus_register and can be compiled without CONFIG_OF.
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register
  2021-05-18 17:49 [PATCH net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register Vladimir Oltean
  2021-05-18 17:51 ` Florian Fainelli
@ 2021-05-18 21:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-18 21:00 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: kuba, davem, netdev, f.fainelli, sfr, ansuelsmth, john, robh+dt,
	frowand.list, andrew, hkallweit1, linux, rdunlap

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 18 May 2021 20:49:24 +0300 you wrote:
> Similar to the way in which of_mdiobus_register() has a fallback to the
> non-DT based mdiobus_register() when CONFIG_OF is not set, we can create
> a shim for the device-managed devm_of_mdiobus_register() which calls
> devm_mdiobus_register() and discards the struct device_node *.
> 
> In particular, this solves a build issue with the qca8k DSA driver which
> uses devm_of_mdiobus_register and can be compiled without CONFIG_OF.
> 
> [...]

Here is the summary with links:
  - [net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register
    https://git.kernel.org/netdev/net-next/c/86544c3de6a2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-18 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 17:49 [PATCH net-next] net: mdio: provide shim implementation of devm_of_mdiobus_register Vladimir Oltean
2021-05-18 17:51 ` Florian Fainelli
2021-05-18 21:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.