Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3118633rdb; Tue, 29 Aug 2023 06:07:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpOecb1mzzjwVBw+Z8/R+TR1AvFXvBRSnGC/LtLmHtfn2ihFHGj1sMbEcNFkWF85Cwmidt X-Received: by 2002:a05:6402:1001:b0:525:4472:3147 with SMTP id c1-20020a056402100100b0052544723147mr21279044edu.34.1693314444428; Tue, 29 Aug 2023 06:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693314444; cv=none; d=google.com; s=arc-20160816; b=szq1lfRP8EEbMLvDmLSHp0OcVYOHNGuDrvUstAkzjWXI8+7V8/D+wYG+Xp2f712nG/ vGtf5zpaZ+1TrHA5IDGEtDTMR96R8KPF7SAQrVPgKiECM+JtN9iW9lwKSu/x7hQNWgsC dbtRckta42JwUlI4eqcu+JLaBqthJ/m7UkEC/SLVLt1XA6JCuc0cPZBSd/acXWGiXTj+ S8aVK8ddiu7suoCk5foSNj57Tx277FIfzS3HQe9EK16e9f/4p/+1P80e7xTY9dZSQvWH T4RGkECZ4U/rJsAYdZfRSsazy7Cmqi7iDaKamowTL5efb3p/eN9zLtXSBPaBJdSNCkz5 bKBw== 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=7w7h0lxk1t21eFOi9jZPaBYQeLyrd9sxN8nlcFvFA2I=; fh=r/VVG12KmrF+nQv7lC2x2sQ0qQnFs7bJUsMqdUzXKDU=; b=LYNKIBVnnNbSlnjXhgNm6FxFItdgqq4F3kEvf40RGCwjaenxf+nRM4tVCQa9ldHLpn td8lghEM0NW7U54AUkj2375P8HVW9yU8D2M3H0Y/XlHb9hVDavqGK91mxWsHt+SVo3SQ vO0V5/0wr7wsEopvMxHEtOIxEV4oNWkXxKyMRtimc4t6gsoTbtaZgb191o6tm0r1ELC1 cYunv+mBEaSqUSEqjZU0ddeOz4IiN2mWQt7q6OwoMjVjnpdvVo25Ou8bs3JUuQf2PqJm 6wBg/HrcRYxXEILjFj+1oLfn6mZHBGFTnY8UMiQLuR5+dTSrhKhCRJ/l+XIWTxAr/F/h yKyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HQCzh2+e; 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 s14-20020a05640217ce00b0052bd60fc635si253197edy.451.2023.08.29.06.06.25; Tue, 29 Aug 2023 06:07:24 -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=HQCzh2+e; 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 S235353AbjH2KzB (ORCPT + 99 others); Tue, 29 Aug 2023 06:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235359AbjH2Ky1 (ORCPT ); Tue, 29 Aug 2023 06:54:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17FA5E6B for ; Tue, 29 Aug 2023 03:53:59 -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 407EC654A3 for ; 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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(). 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; } -- 2.40.1