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 9B32DC6FD1F for ; Sun, 19 Mar 2023 17:05:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A7C285B6E; Sun, 19 Mar 2023 18:05:32 +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="Nl2jMM+I"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="fLl9Dogk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6D31685B0C; Sun, 19 Mar 2023 18:04:45 +0100 (CET) Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [IPv6:2001:67c:2050:0:465::103]) (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 DFC5385AB1 for ; Sun, 19 Mar 2023 18:04:18 +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 [10.196.197.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-103.mailbox.org (Postfix) with ESMTPS id 4Pfkjq55lmz9sTV; Sun, 19 Mar 2023 18:04:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1679245455; 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=7PEHBOKAzcrpbT2GCl735MpxDiuf+z8uRNozu01lfA0=; b=Nl2jMM+IoWPMoN07ZosqcXy6FJFU7slvQZGEMatnAC7yfA7L7c4loXgNb1qPmVEwOhmoLG P+rukJ+/lgPfijyPTrfIgSy/M/vp7t6maWiMzTJUsCFxoeG5vplHI35OKjJ/vM4Izh7VjG 4TJCKutB7E7pLnxcqapmfCgTjWc1vNwbIqlxVdtU3+R/o/r1U3CtoGUXBb/WRPFBzgifq6 0vgbvQ07ZHWlbUhRCYapsgP6fxLMPxbCaPMfAKkhQviURK3w9uYvaKR5il/eczZq/q1H9a nclGBQ+6QJrOcQtpJSyabkvmLyKXMO9e4usSDOgbcgF28JIpVCDE6wqcI62E6w== From: Marek Vasut DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1679245453; 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=7PEHBOKAzcrpbT2GCl735MpxDiuf+z8uRNozu01lfA0=; b=fLl9Dogk+FPsntbYqMRZbzR3eFfvZYZT+QK270NkANawyiX8Ve4RAzp4nOK8QNM+R4GXzh JMGsX9K/Bw11tMsildtkcY8/NGXiFg9/bW4STxaavtOGE9aiQZZVu8bBZcjbyk+8ijVtw3 zUcCG5jv9tmxA373PPrIhm/wYu3pWd5dluiWGs6rW6dlt4Ed2/MaUKzux2mIDTyuZ8bf2E RhmTZYa55LRYFvp7LULlBxgGU4cBOVtk34pwhvQRMStTxREEJW+qaYuKJxpl41Mi8Zhr98 TYhoPmJxbMw5HIxsBO5E6WJZYy3NfIUHtwa01jC871WV86vQP4CBcAovu8M99w== 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 05/41] net: phy: Factor manual relocation into separate function Date: Sun, 19 Mar 2023 18:02:41 +0100 Message-Id: <20230319170317.27711-5-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-META: yd691w9qmxs8epx6onwzkfkzjgity6z3 X-MBO-RS-ID: f3b9b718aa8301a0b0a 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 Create separate function to implement manual relocation of PHY driver functions and make use of that function. This is a preparatory patch for introduction of PHY driver definition using linker lists. No functional change. 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 | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 80230b907c1..5097c32b829 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -470,6 +470,28 @@ static int genphy_init(void) static LIST_HEAD(phy_drivers); +#ifdef CONFIG_NEEDS_MANUAL_RELOC +static void phy_drv_reloc(struct phy_driver *drv) +{ + if (drv->probe) + drv->probe += gd->reloc_off; + if (drv->config) + drv->config += gd->reloc_off; + if (drv->startup) + drv->startup += gd->reloc_off; + if (drv->shutdown) + drv->shutdown += gd->reloc_off; + if (drv->readext) + drv->readext += gd->reloc_off; + if (drv->writeext) + drv->writeext += gd->reloc_off; + if (drv->read_mmd) + drv->read_mmd += gd->reloc_off; + if (drv->write_mmd) + drv->write_mmd += gd->reloc_off; +} +#endif + int phy_init(void) { #ifdef CONFIG_NEEDS_MANUAL_RELOC @@ -582,22 +604,7 @@ int phy_register(struct phy_driver *drv) list_add_tail(&drv->list, &phy_drivers); #ifdef CONFIG_NEEDS_MANUAL_RELOC - if (drv->probe) - drv->probe += gd->reloc_off; - if (drv->config) - drv->config += gd->reloc_off; - if (drv->startup) - drv->startup += gd->reloc_off; - if (drv->shutdown) - drv->shutdown += gd->reloc_off; - if (drv->readext) - drv->readext += gd->reloc_off; - if (drv->writeext) - drv->writeext += gd->reloc_off; - if (drv->read_mmd) - drv->read_mmd += gd->reloc_off; - if (drv->write_mmd) - drv->write_mmd += gd->reloc_off; + phy_drv_reloc(drv); #endif return 0; } -- 2.39.2