Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3213750rdb; Tue, 29 Aug 2023 08:33:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYYDIwT4yiYw49s/TSdHnZZfn5ydChY1NdZ/1pfAwItQ1IBMgeHzoM2c635y74S0Jdek8R X-Received: by 2002:a17:90b:30cc:b0:262:ee7d:2d20 with SMTP id hi12-20020a17090b30cc00b00262ee7d2d20mr26017995pjb.12.1693323212817; Tue, 29 Aug 2023 08:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693323212; cv=none; d=google.com; s=arc-20160816; b=p11Pr2wIeladY3mG0+Z8IBK+mJUZPr6SWHlhSnqO5ELSrK5yxnvHpYfPwaXUG7DRHB YUIxWlqxos3rjpeHEuxvjW5xoZs4161uJd8vgPbvP83J67HFGuDOpluTDx392bLLiMQy b2QGkt+uQ8gGiNMXGHxO0TnWdhcLXrn7IQJ4kt5jzh7Xwp8sA+qzlDwhU7anVBYdCZ+F Nkms6ki9Vi5nAs4OVt1Q1PKGw3eOWEGELMRUNPCIOaoqry+CZogcujoWs1YUi17HgRoN N/s3LCP9nYTE26bZIYNABoSbLLawrwjoSHQInHQ8HRRkN9dKgQo9bywNszn9wI1yryQz wtXg== 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=9IkZLqNlNl48kVgXX43AJVKuFDhZ8UbjQSK7JQKUyEA=; fh=r/VVG12KmrF+nQv7lC2x2sQ0qQnFs7bJUsMqdUzXKDU=; b=sv2I5CzgyXLG+2r2fZnSzkSjFiLyWPpEv5zRP9thU2LXOtvZMo4Vx4/9LH7CefUi9u slJ7J5BuFVbiRsTVf0LQ3/DP1L5Wd9OE3YMTspeC5x0Ati3wkRpvesitFVljEw0EB/2u 6LRcaXdGuMJtfnT7OWjQYFkFkz6H9rMbbA7fvbBdZThPcG2C2G1tInIj/RaX87zTtMg0 PiYC5EZSwunIwZkQe5ITagaJjRDoSwDb3RxeTEssG6FQfX7poO3T5VDZ8cIeqodrp92G 3jMNKTElBJzx5tYfqBuHVjNneAe1GV9PCn+ZQHJwJcZeMjfAOoovVLMByGq64T+G3bcX eYBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gNCFceCc; 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 fz4-20020a17090b024400b00258996c09e4si9518250pjb.22.2023.08.29.08.33.14; Tue, 29 Aug 2023 08:33:32 -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=gNCFceCc; 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 S235180AbjH2Ky3 (ORCPT + 99 others); Tue, 29 Aug 2023 06:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235216AbjH2KyI (ORCPT ); Tue, 29 Aug 2023 06:54:08 -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 70AB8E41 for ; Tue, 29 Aug 2023 03:53:37 -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 C50B765477 for ; Tue, 29 Aug 2023 10:53:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C13A9C433CB; Tue, 29 Aug 2023 10:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306416; bh=dqxGACbIzG+c4wvKf/T/eZtPgkfhpdBlD0whApGU3fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gNCFceCcznbfb4il/U834RiGeYZKk2vbe6kR5Xqd4SgR/E7h8rX4UDuTHLnhJkMbV X0njrltOaPqTQZdHViHSH72DNqNT9BntBPW7AjB8A621QXBwYAJ7TtMIkK+zl9iXU6 kvEHs+jztEVkpIEABK1jF+X3rk8fH7U6oFZgUOm+nMzipAyvwuOZO5DHF9xv81sfpL HbwFW2DhxlKLSBhfu/slhrvf6OyCQHEA3p0+pQ00DNunfGIgTsaX1mW2PHDUIzCDQ0 u4roCp8p99xNsW1ZKseSNJzfiQWhsRvE7JLp2rA6LhJWQe5PyjcP9r0TgZwScEPwM+ dGYVceD6lQJoA== 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 10/22] net: stmmac: dwmac-mediatek: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:21 +0800 Message-Id: <20230829104033.955-11-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-mediatek.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c index 7580077383c0..1c37df6d22b3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c @@ -656,7 +656,7 @@ static int mediatek_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); @@ -665,7 +665,7 @@ static int mediatek_dwmac_probe(struct platform_device *pdev) ret = mediatek_dwmac_clks_config(priv_plat, true); if (ret) - goto err_remove_config_dt; + return ret; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) @@ -675,8 +675,6 @@ static int mediatek_dwmac_probe(struct platform_device *pdev) err_drv_probe: mediatek_dwmac_clks_config(priv_plat, false); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } @@ -685,7 +683,7 @@ static void mediatek_dwmac_remove(struct platform_device *pdev) { struct mediatek_dwmac_plat_data *priv_plat = get_stmmac_bsp_priv(&pdev->dev); - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); mediatek_dwmac_clks_config(priv_plat, false); } -- 2.40.1