ravb: Add support for an optional MDIO mode
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Mon, 25 Mar 2024 15:34:51 +0000 (16:34 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 01:17:52 +0000 (18:17 -0700)
commit2c60c4c008d4b05b9b65bf88f784556208029333
tree13e11dbd3ac08d9ad5b9912bc8f2481f89833329
parenta87590c45c87424953118e8a43f36d967f3ca406
ravb: Add support for an optional MDIO mode

The driver used the DT node of the device itself when registering the
MDIO bus. While this works, it creates a problem: it forces any MDIO bus
properties to also be set on the devices DT node. This mixes the
properties of two distinctly different things and is confusing.

This change adds support for an optional mdio node to be defined as a
child to the device DT node. The child node can then be used to describe
MDIO bus properties that the MDIO core can act on when registering the
bus.

If no mdio child node is found the driver fallback to the old behavior
and register the MDIO bus using the device DT node. This change is
backward compatible with old bindings in use.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240325153451.2366083-3-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/renesas/ravb_main.c