Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3139139rdb; Tue, 29 Aug 2023 06:36:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvrnpzAJhTeJiZgSSUgB5Fy8PX7Y28d9ch8+HdEVkNlibqtXlWWj3SLcv7D6Yqfl/1UC7t X-Received: by 2002:a17:903:244a:b0:1b5:561a:5ca9 with SMTP id l10-20020a170903244a00b001b5561a5ca9mr26054637pls.50.1693316203798; Tue, 29 Aug 2023 06:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693316203; cv=none; d=google.com; s=arc-20160816; b=oa//HKY6DG/IjjukEorfKPM6F9/O728woVtvCvmTGEWKDwP6qYmoLUH2TQalhhVO30 wVfs0PVlV/MET5snJIxo1OQ5qOBRtRJ7xwXn9/FfQH9JQGfg0dX5b5hTAfpmtbH4gX0S ytxN7dwkzulOrxlZeNiS16PrPLv+Rgehr/3RDp/CFinJ3ksBxCBNXgrdQg4UElNBA+g0 NRj7cMW05ijiLN72JiHaK1TUL6kA6ZCW+N9sQ9XXcyUKEipnE8E7YQddwWBF0/VOIj8v OcHT61FvOL5QhwrRsVqykP7sPt7fevjzH421iVXSvA7Bj1zlL1N6N+0w0ovPIYDaeAWh +Urg== 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=HihMrabtMUvc3Og1PWrpWVQt7ROpK4++wOC/ZCIKRTo=; fh=r/VVG12KmrF+nQv7lC2x2sQ0qQnFs7bJUsMqdUzXKDU=; b=tdypEqZjaYCEsyZ9WkMtxxqxdKg141Us+PDrXtM5Pm89pcy8jO1WsVJcq80cRMyg1i 8QQN1BaFioDLgvweX2pL/2B+y7hkLdTz1sz4PneDczhAgPMzNgfNJFQ/+YKBW07Zfnsx 09eksqZGUvfsWHwUk1v4QUjPve6trDD4aFeUFmX540TVceisyfSgBdLA4ep4T/4Z9LIw RJ1AlK4lZz4K2Tl7rytb4rfOJFhfbeX/94rXC+V6xh+/B8dBsZPLqnH8ICP8Gc7vsMYw Gcax8bDqHS28exIBmsHvgTucdLNs8L8HCipsqOhJiBKBUR2NOE09erpOGGcNQsxfNe70 DItQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="iJsu/I3d"; 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 i2-20020a170902c94200b001b9e9b21280si272818pla.592.2023.08.29.06.36.22; Tue, 29 Aug 2023 06:36:43 -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="iJsu/I3d"; 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 S232277AbjH2KxY (ORCPT + 99 others); Tue, 29 Aug 2023 06:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231379AbjH2Kww (ORCPT ); Tue, 29 Aug 2023 06:52:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D0449E for ; Tue, 29 Aug 2023 03:52:50 -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 9F7706543D for ; Tue, 29 Aug 2023 10:52:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA5E2C433C9; Tue, 29 Aug 2023 10:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306369; bh=R5nkuuiNFkrWBoIZMqvZG0C7QkTrSVA812AJPM93YC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJsu/I3d87cvHLK0Qgq+FtAhg4MTdzl3KQQ2FINF1VhorGE0SMH9XFIO3zlJvpvsa IxrTWPp0pXrzu3s5EXKgFU2QxWW3G9LGqR7t7wKk1QgRo+ZO130xflrB7lto9iB9aa d8HmMmgA5B/Irwo+1l3feOkwjXW9f3GhIlIxbUyJ2rw6+k/4nJdNXhszgGs8k7Edy/ 2n6N/9DaRQih16aotIDSDnTn5t2uAFk0MUI5wu0rrTg+9l0R7d/B3MCehS71dZMI5z 5LAs+uKq3Q8wEY6000Q7lO4uMAbjnTY7nRP8kRwcVbuiZUNWvuzmYEELEu9pNxjkkK aXXMJx7SVFgpA== 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 03/22] net: stmmac: dwmac-generic: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:14 +0800 Message-Id: <20230829104033.955-4-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 --- .../net/ethernet/stmicro/stmmac/dwmac-generic.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c index 20fc455b3337..84582fc04d2e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c @@ -27,7 +27,7 @@ static int dwmac_generic_probe(struct platform_device *pdev) return ret; if (pdev->dev.of_node) { - 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)) { dev_err(&pdev->dev, "dt configuration failed\n"); return PTR_ERR(plat_dat); @@ -46,17 +46,7 @@ static int dwmac_generic_probe(struct platform_device *pdev) plat_dat->unicast_filter_entries = 1; } - ret = stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res); - if (ret) - goto err_remove_config_dt; - - return 0; - -err_remove_config_dt: - if (pdev->dev.of_node) - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; + return stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res); } static const struct of_device_id dwmac_generic_match[] = { @@ -77,7 +67,7 @@ MODULE_DEVICE_TABLE(of, dwmac_generic_match); static struct platform_driver dwmac_generic_driver = { .probe = dwmac_generic_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = STMMAC_RESOURCE_NAME, .pm = &stmmac_pltfr_pm_ops, -- 2.40.1