summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-03-19 18:03:14 +0100
committerMarek Vasut <marek.vasut+renesas@mailbox.org>2023-04-07 14:18:51 +0200
commit8728d4c032571a8569af14d09d18bf444c30e446 (patch)
treed4aece48e0b8134ec18b79aba5fb320e85de36cc /drivers/net/phy/phy.c
parent20bd8e4fcbb537be0f564bbc90e3a571aeeabf8d (diff)
downloadu-boot-8728d4c032571a8569af14d09d18bf444c30e446.tar.gz
net: phy: Drop static phy_drivers list
The static phy_drivers list is superseded by linker list of struct phy_drivers now that all drivers have been converted to the later. Drop the phy_drivers list as well as list_head from struct phy_driver. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Michal Simek <michal.simek@amd.com> Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index bd9c576f45..f4aa1f664c 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -463,8 +463,6 @@ U_BOOT_PHY_DRIVER(genphy) = {
.shutdown = genphy_shutdown,
};
-static LIST_HEAD(phy_drivers);
-
#ifdef CONFIG_NEEDS_MANUAL_RELOC
static void phy_drv_reloc(struct phy_driver *drv)
{
@@ -493,16 +491,6 @@ int phy_init(void)
const int ll_n_ents = ll_entry_count(struct phy_driver, phy_driver);
struct phy_driver *drv, *ll_entry;
- /*
- * The pointers inside phy_drivers also needs to be updated incase of
- * manual reloc, without which these points to some invalid
- * pre reloc address and leads to invalid accesses, hangs.
- */
- struct list_head *head = &phy_drivers;
-
- head->next = (void *)head->next + gd->reloc_off;
- head->prev = (void *)head->prev + gd->reloc_off;
-
/* Perform manual relocation on linker list based PHY drivers */
ll_entry = ll_entry_start(struct phy_driver, phy_driver);
for (drv = ll_entry; drv != ll_entry + ll_n_ents; drv++)
@@ -514,9 +502,6 @@ int phy_init(void)
int phy_register(struct phy_driver *drv)
{
- INIT_LIST_HEAD(&drv->list);
- list_add_tail(&drv->list, &phy_drivers);
-
#ifdef CONFIG_NEEDS_MANUAL_RELOC
phy_drv_reloc(drv);
#endif
@@ -575,16 +560,9 @@ static struct phy_driver *generic_for_phy(struct phy_device *phydev)
static struct phy_driver *get_phy_driver(struct phy_device *phydev)
{
const int ll_n_ents = ll_entry_count(struct phy_driver, phy_driver);
- struct phy_driver *ll_entry;
- struct list_head *entry;
int phy_id = phydev->phy_id;
- struct phy_driver *drv = NULL;
-
- list_for_each(entry, &phy_drivers) {
- drv = list_entry(entry, struct phy_driver, list);
- if ((drv->uid & drv->mask) == (phy_id & drv->mask))
- return drv;
- }
+ struct phy_driver *ll_entry;
+ struct phy_driver *drv;
ll_entry = ll_entry_start(struct phy_driver, phy_driver);
for (drv = ll_entry; drv != ll_entry + ll_n_ents; drv++)