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 435E2C433EF for ; Wed, 27 Apr 2022 10:42:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 378FC83EAD; Wed, 27 Apr 2022 12:42:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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; unprotected) header.d=kernel.org header.i=@kernel.org header.b="tRz6tZRa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5308883DFE; Wed, 27 Apr 2022 12:42:16 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E4FA983DFE for ; Wed, 27 Apr 2022 12:42:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E6DAB82524; Wed, 27 Apr 2022 10:42:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96BEEC385AE; Wed, 27 Apr 2022 10:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056131; bh=0zwrTdoOGSazri3loobOmRmMNeI+2mBRcs8tHUsSv4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tRz6tZRaCECXiPsQFb9skafDH+1ZdZEqvHziTRtdD6akLHiiBOoC3ldWUt3tl+OhU iKm2JWl578qULu0dVsxLtNBAOqVwa3Y+N+AgPuysbsqjLZYXgSS7qxEHnYNxPKBtJC /DVMs9VdhukUmJpSoXXELikcNpHtrZHyztTo1IXncXsWhqfxs31atuuj47knRa5Ql6 mdulRFKnTDZjY84zUBkL2yp7f+DesDPY7+eGllOqFDqcKhNIVX9FnSELjzGC4yIGkl 1m2141pfcUXy7jsDg6HzSaKzNUNDhmEl2MNq3KvNwMYQ5aFtkcWbvLRSDCRN+lK1M8 IuIfICILY3HnA== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?UTF-8?q?Pali=20Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 01/19] net: mvneta: Get rid of platdata Date: Wed, 27 Apr 2022 12:41:44 +0200 Message-Id: <20220427104202.1205-2-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn Drop .of_to_plat() from the mvneta driver and parse the two properties in .probe(). Signed-off-by: Marek BehĂșn --- drivers/net/mvneta.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 15dc714058..d1c5f7930d 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1692,7 +1692,6 @@ static int mvneta_recv(struct udevice *dev, int flags, uchar **packetp) static int mvneta_probe(struct udevice *dev) { - struct eth_pdata *pdata = dev_get_plat(dev); struct mvneta_port *pp = dev_get_priv(dev); #if CONFIG_IS_ENABLED(DM_GPIO) struct ofnode_phandle_args sfp_args; @@ -1729,7 +1728,10 @@ static int mvneta_probe(struct udevice *dev) buffer_loc.rx_buffers = (phys_addr_t)(bd_space + size); } - pp->base = (void __iomem *)pdata->iobase; + pp->base = dev_read_addr_ptr(dev); + pp->phy_interface = dev_read_phy_mode(dev); + if (pp->phy_interface == PHY_INTERFACE_MODE_NA) + return -EINVAL; /* Configure MBUS address windows */ if (device_is_compatible(dev, "marvell,armada-3700-neta")) @@ -1737,9 +1739,6 @@ static int mvneta_probe(struct udevice *dev) else mvneta_conf_mbus_windows(pp); - /* PHY interface is already decoded in mvneta_of_to_plat() */ - pp->phy_interface = pdata->phy_interface; - /* fetch 'fixed-link' property from 'neta' node */ fl_node = fdt_subnode_offset(blob, node, "fixed-link"); if (fl_node != -FDT_ERR_NOTFOUND) { @@ -1808,20 +1807,6 @@ static const struct eth_ops mvneta_ops = { .write_hwaddr = mvneta_write_hwaddr, }; -static int mvneta_of_to_plat(struct udevice *dev) -{ - struct eth_pdata *pdata = dev_get_plat(dev); - - pdata->iobase = dev_read_addr(dev); - - /* Get phy-mode / phy_interface from DT */ - pdata->phy_interface = dev_read_phy_mode(dev); - if (pdata->phy_interface == PHY_INTERFACE_MODE_NA) - return -EINVAL; - - return 0; -} - static const struct udevice_id mvneta_ids[] = { { .compatible = "marvell,armada-370-neta" }, { .compatible = "marvell,armada-xp-neta" }, @@ -1833,7 +1818,6 @@ U_BOOT_DRIVER(mvneta) = { .name = "mvneta", .id = UCLASS_ETH, .of_match = mvneta_ids, - .of_to_plat = mvneta_of_to_plat, .probe = mvneta_probe, .ops = &mvneta_ops, .priv_auto = sizeof(struct mvneta_port), -- 2.35.1