From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 957BEC6FD1F for ; Sun, 19 Mar 2023 17:10:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 87A3C85CA6; Sun, 19 Mar 2023 18:08:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=mailbox.org header.i=@mailbox.org header.b="uFES4EfI"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="s7MgWz1k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AAF5085BAC; Sun, 19 Mar 2023 18:07:23 +0100 (CET) Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6DC6F85CC3 for ; Sun, 19 Mar 2023 18:05:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut+renesas@mailbox.org Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Pfklb0lyvz9sck; Sun, 19 Mar 2023 18:05:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1679245547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sjtyAuvcENnxlgmYHasIyfbJeEI2PMbyrRzxX/tZBp8=; b=uFES4EfIn6D+9fH4r/sdTQkM6HV1btpslXcnI8CUJtqYSzYJuXExJRaGXhsIzGN+U/Muqu xzwpKk3n/MRTN5yN0ttNYiUX2/pfoNPTfuEBJzAgfg+nnpJluaURveze5zETEfHVcO4jX/ jpfMCte+Kaiww0QRbL9SIKvhzQSdK3G9Y1oB1NejK1MeBue8HVF6fRyKUKO1fx867A6+E+ SXuss1op7eBwo2Pqk8EqN9Z4Y37M7ON2/pn1fEPStQPSkCEP+bSdW81qWViUyA/ymZU2nO +emUmhWF7u71dYn9dmHLB2JORUivdaXeA568WvpZYgRaeh18QDh2tz5WlWP9Qg== From: Marek Vasut DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1679245544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sjtyAuvcENnxlgmYHasIyfbJeEI2PMbyrRzxX/tZBp8=; b=s7MgWz1kKU56KMSBwq9lx7MngYu4T9LFI6/J9dNfxcSuRATiKeDq4pojy1cV2Tkv5cLRfk hWgkOgS+7Bf/tTxK4Ye7/xyqytQ1u54MAAwDo9u0slx7v5cbYtcMT+m6c70ME6tKW1i5lI fSzG2nF54RpMgEmaJSUj3TPRegtrOYTzsvRVOwUl/LrLfJxJkSsAzGTY0RuGWNcy8Fyh2c 8tjHXNIxudW3R7QSNBSfow7a47MU0R3Feqdunla3dBaG/DkI4UxUgNduYspAasmZDsh5Ex nbWeWYw2Kb6218GAzFdtzm+XNk9EIyjxoEeC/qFSZr8NgsCPBkoKuQM/4xtugQ== To: u-boot@lists.denx.de Cc: Marek Vasut , "Ariel D'Alessandro" , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Alex Nemirovsky , Haolin Li , Heinrich Schuchardt , Joe Hershberger , Joel Stanley , Josua Mayer , Michael Trimarchi , Michal Simek , Nate Drude , Neil Armstrong , Radu Pirea , Ramon Fried , Samuel Mendoza-Jonas , Stefan Roese , T Karthik Reddy , Tim Harvey , Vladimir Oltean , u-boot-amlogic@groups.io Subject: [PATCH 38/41] net: phy: Drop static phy_drivers list Date: Sun, 19 Mar 2023 18:03:14 +0100 Message-Id: <20230319170317.27711-38-marek.vasut+renesas@mailbox.org> In-Reply-To: <20230319170317.27711-1-marek.vasut+renesas@mailbox.org> References: <20230319170317.27711-1-marek.vasut+renesas@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MBO-RS-ID: f9382bb497d01967427 X-MBO-RS-META: 5sn4meb3jbara1hcbqfgmont9wfygh3u X-Rspamd-Queue-Id: 4Pfklb0lyvz9sck X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 --- Cc: "Ariel D'Alessandro" Cc: "Cédric Le Goater" Cc: "Marek Behún" Cc: Alex Nemirovsky Cc: Haolin Li Cc: Heinrich Schuchardt Cc: Joe Hershberger Cc: Joel Stanley Cc: Josua Mayer Cc: Marek Vasut Cc: Michael Trimarchi Cc: Michal Simek Cc: Nate Drude Cc: Neil Armstrong Cc: Radu Pirea Cc: Ramon Fried Cc: Samuel Mendoza-Jonas Cc: Stefan Roese Cc: T Karthik Reddy Cc: Tim Harvey Cc: Vladimir Oltean Cc: u-boot-amlogic@groups.io --- drivers/net/phy/phy.c | 26 ++------------------------ include/phy.h | 2 -- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index bd9c576f459..f4aa1f664cb 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++) diff --git a/include/phy.h b/include/phy.h index 5f4967cb150..5e8ae5e29aa 100644 --- a/include/phy.h +++ b/include/phy.h @@ -125,8 +125,6 @@ struct phy_driver { int (*write_mmd)(struct phy_device *phydev, int devad, int reg, u16 val); - struct list_head list; - /* driver private data */ ulong data; }; -- 2.39.2