Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3139129rdb; Tue, 29 Aug 2023 06:36:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6jiiKnw9glniEXu2pzQb0UZ9rvXuLJR7vKYuoNVe5r2P2KH+9EbdsApMVUmfaS2VvHZPZ X-Received: by 2002:a17:90b:3712:b0:26b:4ce1:9705 with SMTP id mg18-20020a17090b371200b0026b4ce19705mr22876296pjb.38.1693316203010; Tue, 29 Aug 2023 06:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693316202; cv=none; d=google.com; s=arc-20160816; b=LA5vJ8RWIIO0Btlm4khcQLz6jzG2Jn3lr/AulkNDyOxI8ibFVm4HtL8i3Jlwg0MbSM oya/jwFHXdHtrq64alz0AkXyjBaXD8h3FeSzVi06bl7umsyML1dRTcDt2FS0mEQ2MDwI XdxxPlFdDFuUu0c4T+WUMKJ/fcC6x30eQR6svfenWgbwMQmViLhlj/+YNJv+BOfDReWa /T1ta0sD6PwpsOv18nDTo8vqjgAPoPOPNeq9RkDjzAYs7fy6b4uBrOzDb3tJ1JtORtHa NJ242JhCf8dml7ol9CnutMTuuaEZ1RulzSfj3oej4muQDeJYuQGdjkaNqEaH+wSBDi9j 815Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ir7K2TgyDMN2JNrFe1z8evNf2YIGoOpWJRSFUqqcp6s=; fh=r/VVG12KmrF+nQv7lC2x2sQ0qQnFs7bJUsMqdUzXKDU=; b=iaoE2LQYM47/AWU3fLZBZ+J9wmksHvj8T2qr5Ni/2fh1QXvfr+nDWRkA/02Jsb/TBO 8+/fKbtmsTIAMfpYrl0DZVjLMe7sUOWVLkUdJCyB49feRE9rOnIH8HQok2qDoK30DqYq Tm9VvL62lwdlCIs1bHoHZCQjojRvIsntJZlyMpMOmJBeVLptOuBYnbqTer76mgPAy+To m37IapM/ojWiP7DZ6QR66VnQ/qz+LLNRJdgEMmD7fWs7EBOdpVGqkQotkrRx1/RFMdO8 rwP6B2O5CABbrAWIbzOI63wD72UVUBP2JfOrIR4P7bym9jaeKvb+w4wiIR+z0kxsyhD4 nbuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTPGxZCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a17090a414400b0025979e8c246si2884251pjg.70.2023.08.29.06.36.17; Tue, 29 Aug 2023 06:36:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTPGxZCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235171AbjH2Kze (ORCPT + 99 others); Tue, 29 Aug 2023 06:55:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235330AbjH2KzT (ORCPT ); Tue, 29 Aug 2023 06:55:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E0ECF4 for ; Tue, 29 Aug 2023 03:54:48 -0700 (PDT) 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 DFA096546F for ; Tue, 29 Aug 2023 10:54:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A528C433CA; Tue, 29 Aug 2023 10:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306485; bh=KSe7NuuTmvNFUfkVlgyIp0m+TWXLJzpYZqE/n8ra5Ws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FTPGxZCuLLZc4QW8EWFJFFrdXXOk/U9oGCOR1rpE3WRlVOfOzEifOgkFsWv4EeGYt hSoz/kU4u/35xdFnqiB0BpgZkjKY5Z1guaquCeN2iReO7Qu+FRBtflMtLYC1AQOlHp GH/b0kMQ33KhTgZ1SzDxdrOkKlcYHVw7whbFkPl2BzqGOeetv0pYGQ3+jof+6/IQuA wvbZSg3Di65UmAWOJHw6RnnTjtqcW+kS5fBBKtXQ8HQRfy0fUnpvKFQLXz7nkg+O0r iwu2xgsG5Lbac7cX5de82QoNr//2h1tU2XfDGYkU3Y+JIhf/5aPWZ1gJcUeGwpXw1X Ut+mu5MorOOxQ== 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 20/22] net: stmmac: dwmac-tegra: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:31 +0800 Message-Id: <20230829104033.955-21-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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-tegra.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c index e0f3cbd36852..7e512c0762ea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c @@ -284,7 +284,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) if (err < 0) goto disable_clks; - plat = stmmac_probe_config_dt(pdev, res.mac); + plat = devm_stmmac_probe_config_dt(pdev, res.mac); if (IS_ERR(plat)) { err = PTR_ERR(plat); goto disable_clks; @@ -303,7 +303,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) GFP_KERNEL); if (!plat->mdio_bus_data) { err = -ENOMEM; - goto remove; + goto disable_clks; } } @@ -321,7 +321,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) 500, 500 * 2000); if (err < 0) { dev_err(mgbe->dev, "timeout waiting for TX lane to become enabled\n"); - goto remove; + goto disable_clks; } plat->serdes_powerup = mgbe_uphy_lane_bringup_serdes_up; @@ -342,12 +342,10 @@ static int tegra_mgbe_probe(struct platform_device *pdev) err = stmmac_dvr_probe(&pdev->dev, plat, &res); if (err < 0) - goto remove; + goto disable_clks; return 0; -remove: - stmmac_remove_config_dt(pdev, plat); disable_clks: clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks); @@ -360,7 +358,7 @@ static void tegra_mgbe_remove(struct platform_device *pdev) clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks); - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); } static const struct of_device_id tegra_mgbe_match[] = { -- 2.40.1