Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3149209rdb; Tue, 29 Aug 2023 06:54:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVKddYnYfSjhZhK5myZN9Jsp6A7GnUVjn6UTw4TnWM7URElc9k67zrVuY1/ZBNgZSBLzCr X-Received: by 2002:a17:90a:fa8d:b0:268:5f1a:ede1 with SMTP id cu13-20020a17090afa8d00b002685f1aede1mr22111740pjb.36.1693317257673; Tue, 29 Aug 2023 06:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693317257; cv=none; d=google.com; s=arc-20160816; b=I3XBQI5JTVOoRbZyfqqPuKwlZ0dglzO1ColCvivlepEQHDaEbGRFZiWnvraqYSwfTD 3t6F2DZmQxBMgOwcQb5y26aNC2qxtB5seZDI6zFllgCDvgwYyYP7iIgmnYQb2vAr+008 0fkHe30VqAPIAfAuJxoFsvy0OunZ250hWFeYukO3ILn2aAtFzmpuGka5q7IbwV+Lz6jY kW9ine4TY8QDn2Zdh9GrAHIxskuiekksOiHw+8ir+fxueEfhWHBYuUSMe34mxPBcZ7Ld brM/c/qUiwW+rJrexpUcErdtO7id9AohUy6wK8lmB8Ga+4GUtbhW1Sp4HsqjfO4U8M2k PCag== 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=+V2zt1Fq/mIsCRLrslLMxOJaDJjzmBiZLDl5kNRhkLk=; fh=r/VVG12KmrF+nQv7lC2x2sQ0qQnFs7bJUsMqdUzXKDU=; b=ylSQBTW0PSjKnk2u12b7/t4Oc5SMtGbQVCVx/d5hOF4CSjvdIbWnDlGL//QXT06JON 1OdzvClidjX86c5Pl7zaCFpD9OwKzeD/FE+ObCzBenLwoLMNzacB/30OcvueU9FQDv+B jJxRhEewBqFLZ6JLnc0eTc32JrjLo5g+EmN+LwiwswBk0x/A8mvvnQAeC6pDFFZW9o0Q e46Xu/PxTooMw+l8TR27ADKBU+vnPptyDadRgPb5TbRx2ushCQN8wiXAut9T9wktTMMY CJDApZSXG8f1yBau2yuWrREYpGyKqljoWtRlwYPTtyVUtY8wkIHpTrVFPSscWMp0E9vM 374Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TlKbQjvV; 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 ha15-20020a17090af3cf00b0024e4ace1a41si1516484pjb.183.2023.08.29.06.53.57; Tue, 29 Aug 2023 06:54:17 -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=TlKbQjvV; 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 S235249AbjH2KzG (ORCPT + 99 others); Tue, 29 Aug 2023 06:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235348AbjH2Kym (ORCPT ); Tue, 29 Aug 2023 06:54:42 -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 62D06CEB for ; Tue, 29 Aug 2023 03:54:23 -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 277AD654AA for ; Tue, 29 Aug 2023 10:54:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 465DFC433C8; Tue, 29 Aug 2023 10:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306456; bh=pwxVh7O0mYqw2Ljn4tWnXFw2NWOIpp5wpRx6GKnF3MQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TlKbQjvVK9K4YSKtdymvF/Ur44cypX+U/4zLiElbDFRpRu05lbRZdQkf9hbUN9Us2 m0zFUy/2rxA7JjWHaRt9dO0nQtqgQLhxcz/v3OBG1YuFbKNsaPCzG1hiSokn7hZYjQ 1hj04nbSHJOHKWzZN0/f6gUehOAvk+VR36BiPaSdHUpJTl3WT9u0B/GgPeLOQlkO27 u2tI8RrRRDVKg13ezQU3tJVgzvi2MlqooNH/OCA/0Q/do0Xn2mMNES8SnAa74Rq2na g0bq9Eg+kZvANWD1hn0SvCzWXrxqLaEIUExjRs+j49vZEekSGH9MlANBHsx9t9Yj5H lJvFWybYA14Lw== 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 16/22] net: stmmac: dwmac-sti: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:27 +0800 Message-Id: <20230829104033.955-17-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(). Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c index 0d653bbb931b..4445cddc4cbe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c @@ -273,20 +273,18 @@ static int sti_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); dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); - if (!dwmac) { - ret = -ENOMEM; - goto err_remove_config_dt; - } + if (!dwmac) + return -ENOMEM; ret = sti_dwmac_parse_data(dwmac, pdev); if (ret) { dev_err(&pdev->dev, "Unable to parse OF data\n"); - goto err_remove_config_dt; + return ret; } dwmac->fix_retime_src = data->fix_retime_src; @@ -296,7 +294,7 @@ static int sti_dwmac_probe(struct platform_device *pdev) ret = clk_prepare_enable(dwmac->clk); if (ret) - goto err_remove_config_dt; + return ret; ret = sti_dwmac_set_mode(dwmac); if (ret) @@ -310,8 +308,6 @@ static int sti_dwmac_probe(struct platform_device *pdev) disable_clk: clk_disable_unprepare(dwmac->clk); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } -- 2.40.1