Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3138377rdb; Tue, 29 Aug 2023 06:35:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4NnEAYp1ERJZL2FFKcaOJ14Dks+BPa1CFROO1bwopFI9cW2lzC68nagy1fp08ZfyIX+33 X-Received: by 2002:a2e:7817:0:b0:2bc:da3e:3bd2 with SMTP id t23-20020a2e7817000000b002bcda3e3bd2mr15279370ljc.29.1693316137163; Tue, 29 Aug 2023 06:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693316137; cv=none; d=google.com; s=arc-20160816; b=QBwF0r2JZ6UKZ47H4PG4iqs1Dx4ZG3Fbfu8Clg39VV2AKeWoExhKc9TwItoDfqesdk 3VecJolDLwbKoBNC/3n1s/dmIjWBSlmD6dbhy+VGrvHbL5j548scqRk3mjg/qSFWaq9M hdUr0ee73gHsAuAImTEOdXa5dvoLu11XjJZVzx8HETIkSEALTGNGqk0H1Rou+u2FTE9S a2yvlOKe3o8sVOTj5AORx16Rx1pnrukTXZoOk7QeQjj8a5BPDEHFjllyTSl2G+FdGbAD Q9HYvN2TkbfZA9eAEgM+V1gtjSHWRReg3JAY/d/p0moDmZIoA4YwxDP7ZWZEjv+ZGwN8 5yJQ== 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=ZgDf3qMRmAFXBtEuFlsd8cwStzDGFkC24jPmO6rmYEk=; fh=r/VVG12KmrF+nQv7lC2x2sQ0qQnFs7bJUsMqdUzXKDU=; b=jTUFprJ8x/EOqpqDmCLmj/KahWirCcQRsrjTtqi6CRS+bYCKnOEcwzUGfu/iyZUU7t 63ETpzT9TXq/KOIyf57SESj7oN3suTlJzU2ywUZZaUJwwbNer+JTL+vj3mJjTazlOqO/ kdr8Mp5isiw5W2/ewNSjQqmYKHzqYrvEVPuufF+QBa6qQVD2ojt1wmTEXRSWX+FivA+v pPgkQPKDqdA2+qdpOooE1MV/t2absq+1ILZztf4XdQATEfhXWyJ4Wa6b3w3SNkx6FPvI jifd7N2UKDEcVylhtB4kCUvq6NT9Z0GD+dVEAyP03MnbPqJZw7Peo4VzJb8svmJ47RW4 1Rtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NkzhTqN9; 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 p8-20020a170906614800b009a1bc22b472si5921595ejl.1017.2023.08.29.06.34.53; Tue, 29 Aug 2023 06:35:37 -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=NkzhTqN9; 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 S232006AbjH2Kw4 (ORCPT + 99 others); Tue, 29 Aug 2023 06:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbjH2Kwj (ORCPT ); Tue, 29 Aug 2023 06:52:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A19198 for ; Tue, 29 Aug 2023 03:52:36 -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 1C97565436 for ; Tue, 29 Aug 2023 10:52:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94D1CC433CB; Tue, 29 Aug 2023 10:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306355; bh=OTXCsvCc3TTe8yvZj3iGweMMXsRHTGyqZXpD3RGqgpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NkzhTqN98TTwRlZCKO/14ohdzWUG5Bkr8JjeEbgWi77hFCnKnOR0S3Dst3xxKuYR7 RSx8RBGo/jUzFzjMzYz10vSmA2vtzgE1V6HJ55acD+ACrWB1rYXt/ObTd1b2YDS5gh NUl3sMVvPXXuMWTmOPIb3SF12GIUAMjD2kjYJ0sMc988YzZ2pG5VX7t1DGISy16zg9 tCxfOfCxPWrSw+jZzlszGFkLwo8TXNCpgkyVbfRK+oQ7izHZvhzURnO8o4wlX5Ardn /0nWw46etXTSPR0EYllLXuB5xAs3vSO7ujslVWArhxj4atdu4b05aaMjKOL2vVHNaI BkI/CxjPoaDBg== 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 01/22] net: stmmac: dwmac-anarion: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:12 +0800 Message-Id: <20230829104033.955-2-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(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c index 58a7f08e8d78..0df3a2ad0986 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c @@ -115,7 +115,7 @@ static int anarion_dwmac_probe(struct platform_device *pdev) if (IS_ERR(gmac)) return PTR_ERR(gmac); - 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); @@ -124,13 +124,7 @@ static int anarion_dwmac_probe(struct platform_device *pdev) anarion_gmac_init(pdev, gmac); plat_dat->bsp_priv = gmac; - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) { - stmmac_remove_config_dt(pdev, plat_dat); - return ret; - } - - return 0; + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); } static const struct of_device_id anarion_dwmac_match[] = { @@ -141,7 +135,7 @@ MODULE_DEVICE_TABLE(of, anarion_dwmac_match); static struct platform_driver anarion_dwmac_driver = { .probe = anarion_dwmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "anarion-dwmac", .pm = &stmmac_pltfr_pm_ops, -- 2.40.1