Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3067340rdb; Tue, 29 Aug 2023 04:37:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqH1siv5SHYIIe65GGiABc2FPfAHQ9BwEZ6HCTnzYTVwWQyOAEVdEhnWN+kGHHxEQ/SHUH X-Received: by 2002:a05:6a20:914b:b0:140:c838:2b2e with SMTP id x11-20020a056a20914b00b00140c8382b2emr28205132pzc.22.1693309024156; Tue, 29 Aug 2023 04:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693309024; cv=none; d=google.com; s=arc-20160816; b=ZhsTXj4iT4neNZJGW/H9+8dmH9TjOM3Y72E1zzcfsPvw2eNd2/x8MYSUaMrRqwv48E Cg/tpyDVi6N9UllViBX5ZoHDoWYPcrvkiiDXL7OUo/HMJh2kz15x1oE/wfz84FExEIlj SD2+Nw+JDIDwOJyoIqaDtZlwYtcBleTTJU43OxKFTTs+gUf54XouMR6AGhPgOhDw8gMg gDQm7Wxx9iz/KRqlGt0LeblNIZK2kqwf4pUJ+IXw4railG3saAHz66kpbAn2c74xZ4Hr T75Op7o7l4BXHnRLicgMt30bboRDZrNitd9wu/PUIFLPyEcXAP5wIxldjaDMnv8tvKTh H9FA== 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=UZRfs+fOkCb9X9Y+HxKA0uqb8wNhWS2v/0eF2C7lZtA=; fh=r/VVG12KmrF+nQv7lC2x2sQ0qQnFs7bJUsMqdUzXKDU=; b=kT6SxzszgKYdhFPKHA/eW1zoz6cbd+TLN9FSRtIEa+VNkiYPIrRgodd3MLpr2yhfWk ySzIMoJ458nySfrE0J7bayYJqS7UGsrfLEUMnC01uVH1Td6ymDvXFYz+2gV8JT+os7Ts 2yxkC9trAPb03ZCUysKgsFI04+Q9eNo6gf9NJbCfyuMCHcyWvqTXpxonW4vV5gdDpGyQ vXrCr+tLyO4R3gZ5b68RYlZ6tQF6BBnzZI2ryY8qYViCYodhIO9p1b16eceF1jYlX7lQ taCtEgNxAF7SlFUiK51vlxYm+qHVSDF9uQXP2aXgvwRD8jTSGSHhRC2MLFpMLO3RDiTg fTeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nrpSCfxF; 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 lg16-20020a170902fb9000b001bf4a1ee37bsi8969985plb.466.2023.08.29.04.36.47; Tue, 29 Aug 2023 04:37:04 -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=nrpSCfxF; 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 S229688AbjH2K4G (ORCPT + 99 others); Tue, 29 Aug 2023 06:56:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235426AbjH2Kz4 (ORCPT ); Tue, 29 Aug 2023 06:55:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E933CE3 for ; Tue, 29 Aug 2023 03:55:32 -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 91890654AF for ; Tue, 29 Aug 2023 10:54:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 400AFC43397; Tue, 29 Aug 2023 10:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693306471; bh=eOQEQqB/E1U1BFvNbWI5sTlMMYgIROpRNWJpNfEu8kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nrpSCfxFAulKCGLD3TfFY01Fe8S7TYz2nQ1geT6dB+adsDb40Y/ZLjMh4TwJ3VE9Q kH5jm6ccuqxqTUtIczCO+l+A1H4YhA4OUrf0t3bHFQxGnpHU/puCMobbwCh8lD83Je QlRxdqd7nhjJPTNXHzznxD7+U8oEgnx1/+wfjECvNY4rwnx0G56oY1OH6jwOtjA06w A9RFeyLBvDXeqsL+eab/HvGM4jHZORZ0iCvcaEYESLcJTbbih79RbX1DdIgexRcNnf xOebA38s2ixp3Q/Qu5Zo14fjO4tG4rqtpDYfmywiiwN8LXODvnMThbbj4jEMJjw7yT uYtjzZ602eq6A== 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 18/22] net: stmmac: dwmac-sun8i: use devm_stmmac_probe_config_dt() Date: Tue, 29 Aug 2023 18:40:29 +0800 Message-Id: <20230829104033.955-19-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 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-sun8i.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index c23420863a8d..bfe49b5a9929 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1224,7 +1224,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) if (ret) return -EINVAL; - 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); @@ -1244,7 +1244,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) ret = sun8i_dwmac_set_syscon(&pdev->dev, plat_dat); if (ret) - goto dwmac_deconfig; + return ret; ret = sun8i_dwmac_init(pdev, plat_dat->bsp_priv); if (ret) @@ -1295,8 +1295,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) sun8i_dwmac_exit(pdev, gmac); dwmac_syscon: sun8i_dwmac_unset_syscon(gmac); -dwmac_deconfig: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } @@ -1314,7 +1312,7 @@ static void sun8i_dwmac_remove(struct platform_device *pdev) clk_put(gmac->ephy_clk); } - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); sun8i_dwmac_unset_syscon(gmac); } -- 2.40.1