From patchwork Tue Aug 29 10:40:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13368851 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 B3FA4C83F17 for ; Tue, 29 Aug 2023 10:54:29 +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=1/C8naj1m7EXXKS45e8hp7/55q66yCSFT0Zlrz/ih3o=; b=ckRB332tLZhHYr 2f/fy4un04gaT2XvlnvR9cqnLnSNFBxVsmPcHpIqQ1MQOeUIBFJTSIYymBdkRgz0cCUXyd8ojolU4 sBE620VkyNKTg4P8J0tgjAVsraA2ZX7sBUoo+LIxt75calnBBjmXNx2PkhL2vvPPsJLc8U2VOo5N8 TLomADXi2Gt6gUeAJYnsD5vtlicOudSdmAVofkjBJfqUtL+kqWEHXU8n+ZIvH0dSTmlXVSuPSTnqf ZqVoDuEEVA9i/a9ZuqaPsULI2KbvCODcR300qqppKdFebNNyIzWX4I+9IWyUsLH17MuBSI45u5OAS br1cvGRD4wHvmrK4qDFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qawMF-00BLI5-0Y; Tue, 29 Aug 2023 10:54:03 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qawLp-00BL5j-10 for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2023 10:53:38 +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 C554C6547B; Tue, 29 Aug 2023 10:53:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C13A9C433CB; Tue, 29 Aug 2023 10:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306416; bh=dqxGACbIzG+c4wvKf/T/eZtPgkfhpdBlD0whApGU3fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gNCFceCcznbfb4il/U834RiGeYZKk2vbe6kR5Xqd4SgR/E7h8rX4UDuTHLnhJkMbV X0njrltOaPqTQZdHViHSH72DNqNT9BntBPW7AjB8A621QXBwYAJ7TtMIkK+zl9iXU6 kvEHs+jztEVkpIEABK1jF+X3rk8fH7U6oFZgUOm+nMzipAyvwuOZO5DHF9xv81sfpL HbwFW2DhxlKLSBhfu/slhrvf6OyCQHEA3p0+pQ00DNunfGIgTsaX1mW2PHDUIzCDQ0 u4roCp8p99xNsW1ZKseSNJzfiQWhsRvE7JLp2rA6LhJWQe5PyjcP9r0TgZwScEPwM+ dGYVceD6lQJoA== 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 10/22] net: stmmac: dwmac-mediatek: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:21 +0800 Message-Id: <20230829104033.955-11-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_035337_432426_0D97EA2C X-CRM114-Status: GOOD ( 14.76 ) 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(). The calling of stmmac_pltfr_remove() now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c index 7580077383c0..1c37df6d22b3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c @@ -656,7 +656,7 @@ static int mediatek_dwmac_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); @@ -665,7 +665,7 @@ static int mediatek_dwmac_probe(struct platform_device *pdev) ret = mediatek_dwmac_clks_config(priv_plat, true); if (ret) - goto err_remove_config_dt; + return ret; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) @@ -675,8 +675,6 @@ static int mediatek_dwmac_probe(struct platform_device *pdev) err_drv_probe: mediatek_dwmac_clks_config(priv_plat, false); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } @@ -685,7 +683,7 @@ static void mediatek_dwmac_remove(struct platform_device *pdev) { struct mediatek_dwmac_plat_data *priv_plat = get_stmmac_bsp_priv(&pdev->dev); - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); mediatek_dwmac_clks_config(priv_plat, false); }