From patchwork Tue Aug 29 10:40:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13368852 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCEB6C83F12 for ; Tue, 29 Aug 2023 10:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wv5sNH7q7GnHKbyB8ll2tkjZ4JITucRitvzm9uQ3mww=; b=2YprPFC443/lpu pxUpIWQCeVjYmpw5S/D1OiZHA6VdbRocMEniUlxovSiUNL8+tzPXxX4VtmxO+9ZhGiIe00yN5TYBz OLv6IDe5b46aZLs8Jzp5vu6AZriGzgy3PThswZW5CuP2o3lOZcEPA/vHVT1uRIEyY5t23q7FS9fai Suu0madPgvxDEryapMt8lGPIzNBuGZDOYnske2naCGlmDnse4ZuAdg7Zq1yleRCgQEXG8hRpSuWxC OMxE4w8jsjtlwfg+UNuNYJtKB6pDCwCKzN1A3pzIaj6NUkcFXJQgWHqB1iv/1EbptF8q9DdeDUJaN q/T+0d7+yQl4/hJVxE0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qawMH-00BLJx-1A; Tue, 29 Aug 2023 10:54:05 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qawMA-00BLGQ-0f for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2023 10:53:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9AD79654B7; Tue, 29 Aug 2023 10:53:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3D4AC433CD; Tue, 29 Aug 2023 10:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306436; bh=QnUj2UcWjwSt/r3IooG168fCs/+hvc8TMJRfrlPuAhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HQCzh2+e4WTaPurAbAgzEWpY0F8UbACCyXNLDJBGaVZL2XMn+LmO9shCkYByhHwyA SadFDfH8WTWWsSYk5GvHFznBBETXmXUgfQYRZBUPGN/IoYvzreR2TIgT3NLMpsyzst j+kjIMILuNR18DML5bPnW6NpBjWN3bNYuuk4Edvt32xU2jxwVbyPclul02sp56Y40x eRTFgFFB0+tEyyiboGANNnYPa1SQIWyLydltIQT9gWbKUazV8ukHbuftuoudUVHOMq EjR1rkfRh9n+i3t+zbjQsZGoodK8qLuR/9QurjoO7/x5IxOS2J3JyEGzHnO6glhVJX E7wQzuz6Ee+WA== From: Jisheng Zhang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Vladimir Zapolskiy , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Emil Renner Berthing , Samin Guo , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 13/22] net: stmmac: dwmac-rk: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:24 +0800 Message-Id: <20230829104033.955-14-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230829104033.955-1-jszhang@kernel.org> References: <20230829104033.955-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230829_035358_339951_15791D5E X-CRM114-Status: GOOD ( 13.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index d920a50dd16c..382e8de1255d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -1824,7 +1824,7 @@ static int rk_gmac_probe(struct platform_device *pdev) if (ret) return ret; - plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac); + plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); if (IS_ERR(plat_dat)) return PTR_ERR(plat_dat); @@ -1836,18 +1836,16 @@ static int rk_gmac_probe(struct platform_device *pdev) plat_dat->fix_mac_speed = rk_fix_speed; plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data); - if (IS_ERR(plat_dat->bsp_priv)) { - ret = PTR_ERR(plat_dat->bsp_priv); - goto err_remove_config_dt; - } + if (IS_ERR(plat_dat->bsp_priv)) + return PTR_ERR(plat_dat->bsp_priv); ret = rk_gmac_clk_init(plat_dat); if (ret) - goto err_remove_config_dt; + return ret; ret = rk_gmac_powerup(plat_dat->bsp_priv); if (ret) - goto err_remove_config_dt; + return ret; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) @@ -1857,8 +1855,6 @@ static int rk_gmac_probe(struct platform_device *pdev) err_gmac_powerdown: rk_gmac_powerdown(plat_dat->bsp_priv); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; }