]> git.ipfire.org Git - thirdparty/u-boot.git/commit - include/exports.h
net: phy: don't require PHY interface mode during PHY creation
authorMarek Behún <marek.behun@nic.cz>
Wed, 6 Apr 2022 22:33:08 +0000 (00:33 +0200)
committerRamon Fried <ramon@neureality.ai>
Sun, 10 Apr 2022 05:44:13 +0000 (08:44 +0300)
commite24b58f5ed4f9a0b5b1c80a5f35aa71fcad7f233
treecb51b913a077436d179a8a5ad5547c876320f525
parentb638814e91f772beb1c05e4d04cf6513ac37af59
net: phy: don't require PHY interface mode during PHY creation

Currently we require PHY interface mode to be known when
finding/creating the PHY - the functions
  * phy_connect_phy_id()
  * phy_device_create()
  * create_phy_by_mask()
  * search_for_existing_phy()
  * get_phy_device_by_mask()
  * phy_find_by_mask()
all require the interface parameter, but the only thing done with it is
that it is assigned to phydev->interface.

This makes it impossible to find a PHY device without overwriting the
set mode.

Since the interface mode is not used during .probe() and should be used
at first in .config(), drop the interface parameter from these
functions. Make the default value of phydev->interface (in
phy_device_create()) to be PHY_INTERFACE_MODE_NA. Move the interface
parameter to phy_connect_dev(), where it should be.

Change all occurrences treewide. In occurrences where we don't call
phy_connect_dev() for some reason (they only configure the PHY without
connecting it to an ethernet controller), set
  phydev->interface = value from phy_find_by_mask call.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
17 files changed:
board/CZ.NIC/turris_mox/turris_mox.c
board/boundary/nitrogen6x/nitrogen6x.c
board/gdsys/a38x/controlcenterdc.c
board/gdsys/a38x/ihs_phys.c
drivers/net/altera_tse.c
drivers/net/ethoc.c
drivers/net/pch_gbe.c
drivers/net/phy/ethernet_id.c
drivers/net/phy/phy.c
drivers/net/phy/xilinx_gmii2rgmii.c
drivers/net/ravb.c
drivers/net/sh_eth.c
drivers/net/sni_ave.c
drivers/net/sunxi_emac.c
include/_exports.h
include/exports.h
include/phy.h