From patchwork Sat Sep 16 07:58:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7BC7CCD37B6 for ; Sat, 16 Sep 2023 08:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZgDf3qMRmAFXBtEuFlsd8cwStzDGFkC24jPmO6rmYEk=; b=muBKK8meQMrWbcgUs2yGBGMwfh WbKbcxTMnNCW8d3uYE55MyrEcIr04gs+ardRfFx8eNPfefIqtiSFWf2bSNPsRw4L63+/c76ptGmm3 Qr3c72lmg1pn23KBcu7JUr34uIRRksv+bAgTbPLZ7Q2c+IPqoPgo1+jCXO7569k5lZHt8wtKPNfpI IiYiSYFIfMbha4oNWBKPAUIT0T6lSjkDHPdl8UU3RWo3ooAHxbNzDH/3olNo/sHanCokJmVCWwtB1 fdR/O9XwLHGOyFwUcHHqfuuBCDAfY/Vp/tu871TzynaEY2DQ6bKmJATpswJnjSHBCg3qk6tkVitJ5 p6EoVvcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQO5-00C8dQ-1I; Sat, 16 Sep 2023 08:10:45 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQO0-00C8bG-12; Sat, 16 Sep 2023 08:10:41 +0000 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 DF96760AEF; Sat, 16 Sep 2023 08:10:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 385F3C433CA; Sat, 16 Sep 2023 08:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851838; bh=OTXCsvCc3TTe8yvZj3iGweMMXsRHTGyqZXpD3RGqgpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZMhh2lw+vln8G8IB4k3d/8NLqMICTmGuIlEbqSsPIXpB0PtK9WqdngXbHvulXIV/V SuIXWXvhdOSgrmZ+wbGqqdWBNFE6CgSxXY12CuSjN0MsiWtN/2mesoPvfNzpUEXRw4 po6sbI5W3IXMUbUQPIuKC/LTSob9SbBb5UUbYQCI06EGOKz5unKAp3g7FEW91/jzbX TVApQIZCoO3FhNksOmH1RcGK8zqZO4QREXQwT9B6B5uTSyOIOXYfzASwtqoegVeAz7 EAnAmlNNMMdQgn42fHz3p2bDykIJO4MUV/LCQ0xtqSqvOfskWulUHjGdJoXg3eK5gV 0jMjLsQP3eTTA== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 01/23] net: stmmac: dwmac-anarion: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:07 +0800 Message-Id: <20230916075829.1560-2-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011040_441432_713C0772 X-CRM114-Status: GOOD ( 13.88 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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, From patchwork Sat Sep 16 07:58:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388168 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3B113CD37B6 for ; Sat, 16 Sep 2023 08:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DbI2w959Q/gMhh2SKWaCmI3cBcqhdTBK27Hihg5lFc8=; b=vBE/bdB1qkcMGxpotYR8zo6LyP VpI58LN8B4lTux8Ldn9zEPdO6W5cCdhBJcHBkRIj01kMxSwj6ljDsUoMBkQ3YZ3sbK1VUhNr2U6ic i0z/DI6E/04P4PBeXLsPWD0x7i/rTjhDybgWm680xXxcgZHuLBhb6TxOe3ksu/5DL47iAM7ki9tj/ 0EKk/jLANoIj6HLhbrsa/5XVsS2yNnLSeMDuAiy6xRdcTsb+uDek+KUYpgmIVdUfvbtMWF7Up1mJE pmH/AyNtuhx8cuEoRu8wiyhzbnSyFaU6hLZktKQatLHfpDnG61vggLQcwCxHA+6qHpUo2pZ4YFErX lPfF7P5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOC-00C8ga-0U; Sat, 16 Sep 2023 08:10:52 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQO7-00C8eC-36; Sat, 16 Sep 2023 08:10:49 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 4AEDCB80AC9; Sat, 16 Sep 2023 08:10:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E60DC433C7; Sat, 16 Sep 2023 08:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851845; bh=YlrN4bDSNF+KqWi7kN9bxa/oeNXOFAT09nZc/x9+vhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eK9TEedsqQfQ/qUwdKzxE0DMYl3ERflK3/+BUKPywqMVYa1Zy2UkD2Bnnal1HKR5G DZtZ1dp5uyhkyXn0pL4FzLOhbSZOesDE4IjP56ngM+3yA6Kadpti7HmM9FdYV9IOai /x7WLaSHQXGbE0W2LOpYTWhv1gtWib1dE1qEgHm2FgnS99OglhmjTBAGjtnZ4K6fHk nU8+oteAKnT+lpWoYwIVaN8mun6Xs/IeJR3EmJiU4FdaRReHtI8eODEdyXft1zr6c4 zxJcfROLXA+fW/8ZdYPDzBt026qgzk0Y60Dw+ytoKuO0mnbVSHRJskDaO8WiG+3yHT J52rtyDieXXeg== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 02/23] net: stmmac: dwmac-dwc-qos-eth: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:08 +0800 Message-Id: <20230916075829.1560-3-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011048_287402_41D72889 X-CRM114-Status: GOOD ( 13.44 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). Signed-off-by: Jisheng Zhang --- .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index 61ebf36da13d..ec924c6c76c6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -435,15 +435,14 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev) if (IS_ERR(stmmac_res.addr)) return PTR_ERR(stmmac_res.addr); - 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); ret = data->probe(pdev, plat_dat, &stmmac_res); if (ret < 0) { dev_err_probe(&pdev->dev, ret, "failed to probe subdriver\n"); - - goto remove_config; + return ret; } ret = dwc_eth_dwmac_config_dt(pdev, plat_dat); @@ -458,25 +457,17 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev) remove: data->remove(pdev); -remove_config: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } static void dwc_eth_dwmac_remove(struct platform_device *pdev) { - struct net_device *ndev = platform_get_drvdata(pdev); - struct stmmac_priv *priv = netdev_priv(ndev); - const struct dwc_eth_dwmac_data *data; - - data = device_get_match_data(&pdev->dev); + const struct dwc_eth_dwmac_data *data = device_get_match_data(&pdev->dev); stmmac_dvr_remove(&pdev->dev); data->remove(pdev); - - stmmac_remove_config_dt(pdev, priv->plat); } static const struct of_device_id dwc_eth_dwmac_match[] = { From patchwork Sat Sep 16 07:58:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13441CD37B5 for ; Sat, 16 Sep 2023 08:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HihMrabtMUvc3Og1PWrpWVQt7ROpK4++wOC/ZCIKRTo=; b=x5cw9Gbit28/IBkOmeeXT7Zydq xcnLAXl6NSc5KSuyTilFbs9BAVi+60ROsKt0mq4J7LmJb2jrQgxAwIc0oThd7kjotoEb/zYCebbuO 6ncD5utYQtCuZ0MkcSIhws7Qk+tcxcHmWY/JvkLk4ICQJ5jzY311UP0vHU6CFBCVoQeSoLk9tbwnn pvNzB9YtlW0bK6kPqSo2kH9pWM3ozubNFJ2cpCNSmKowWLAo7TfOfJBpNfYY06Sxv9wTxvvNwfDzR 2Iw19reOx+ae+enWyk1b8ReJ8XM8L43NclKCcWlvAh/dXbD7gtF9PQmgPlJslRL2olGjd7B76i+Y1 HEbW62fQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOJ-00C8k8-2W; Sat, 16 Sep 2023 08:10:59 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOF-00C8hv-2h; Sat, 16 Sep 2023 08:10:57 +0000 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 515F860AB9; Sat, 16 Sep 2023 08:10:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A202C433C9; Sat, 16 Sep 2023 08:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851852; bh=R5nkuuiNFkrWBoIZMqvZG0C7QkTrSVA812AJPM93YC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/H1dwtuKgkjIYunzM9xo/2q+uyUSMCcCmfrGmFm0GqlpLd05n0eoiu37nqU9B14F ZDdwZp+HFLlYofBUYbFRlSmxg/Vi7yg3Fc0VnC7u0EF89aj8D8hRE2OU5yP6yQRQBv A90KjCUCDlyi+wbVJQRI/BPvgb0oRRv9lH4UGAT4wAW5UeZLqxrwzLkTUxZFrC6R0T 6HEQ6WyCBGHJ+VBEiXNSCu651TrgKkzjevCH7ZUnCPm13PQVuWXWMb72h8bI4sbSxl eQ3Extw4R+KwnNGTEZ3NssrkTVnJ/jd7UPN8ph6gKMB9ygkBDdzyUC4QTHUqn5Mnki QAOXOCrf8hnpQ== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 03/23] net: stmmac: dwmac-generic: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:09 +0800 Message-Id: <20230916075829.1560-4-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011055_960125_72274825 X-CRM114-Status: GOOD ( 14.33 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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, From patchwork Sat Sep 16 07:58:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388170 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A957CD37B5 for ; Sat, 16 Sep 2023 08:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ahEDdKJvfgvlryas2qqoUqx/YZLc0pnlpJ2dmFNr0VI=; b=rU/oDSYRBYxvNA1qfZ7T73oQiK kWeMY0Du8LDGnI/xhzYRVCvJ9Aq+8iAQWjuvpCqOPou9s2zigdXLTBJ7wODhYFBpWYVnjdYl8u4Kv r8ECvW0HjwZ7+tl+c6jrv0m+clpS36cWrsqR5VZhxQwv/f3dlmIJIFfIa4Pa5LgOxATak/lWoWUIE qPV0Ngd0S0ZQ3Cs6XoYS1p9OmiCc5RL2cxAyijKXZpBYfsG5TFgt8GCH3776TUuy+asy6/QDYWqTj IcEW1r2wN5pi3RdEF+tmWF4vJsaWAaGRI4ufjnU8+uryo+4zdwl1wBkk8sqOIVDK0ZW91CCpv2jt2 GrsUPdcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOQ-00C8oZ-35; Sat, 16 Sep 2023 08:11:06 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOM-00C8lI-2q; Sat, 16 Sep 2023 08:11:04 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id E43E7CE2AEF; Sat, 16 Sep 2023 08:11:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14813C433D9; Sat, 16 Sep 2023 08:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851859; bh=QBvxkEj1DY0GKW8rngBNgzoMssSjhwO/YTw1SWluFmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tT1UDKXF4g13p6ekgVnkAUNhKK4luSogO7ZsQtDsbMGYyg5lNE/MlDTnZsWgqpLMA 5t9KZMLqtJ8qV5NwoKHF5AgmuhNlidGy4GcIQAat1PG/1taOzwP5evYs2OSqgTY/bH yYqaCyyOGARBajosF08MOJhLoObkVpzEJnEI2qIDsDAx7O66m7wpy492+cRkUj71gX ssLZYNd6WFrpp4G/eTaq6k8FmSwOsWEzPbycTqUmoJnPw9S8/98qO7vAVugt3fzsTv GKx8+0bK2ZU1P7FUZBU/4lKBAzRT5i3OjZ88i6xGJa7Ozgu4jDV1/T30vYJ9U9ru+e WQzUsx0OKeoQw== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 04/23] net: stmmac: dwmac-generic: use devm_stmmac_pltfr_probe() Date: Sat, 16 Sep 2023 15:58:10 +0800 Message-Id: <20230916075829.1560-5-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011103_111388_329A6936 X-CRM114-Status: GOOD ( 13.06 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Use the devres variant of stmmac_pltfr_probe() and finally drop the remove() hook. Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c index 84582fc04d2e..598eff926815 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c @@ -46,7 +46,7 @@ static int dwmac_generic_probe(struct platform_device *pdev) plat_dat->unicast_filter_entries = 1; } - return stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res); + return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res); } static const struct of_device_id dwmac_generic_match[] = { @@ -67,7 +67,6 @@ MODULE_DEVICE_TABLE(of, dwmac_generic_match); static struct platform_driver dwmac_generic_driver = { .probe = dwmac_generic_probe, - .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = STMMAC_RESOURCE_NAME, .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB73FCD37B5 for ; Sat, 16 Sep 2023 08:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+90apT55wKFaIuTWKGFPlYbpjk2TaCmgpZfkFe//2sw=; b=E3sMHwIGQlzWUcFKhq+V7cwnaH 0NS3fV9qNyP8pn5Y6oR/epA6T/26loPEGiWxqY+gcmJVXLb4Hv+yMmWv25k63coSNdFT0lZ5fyNoL sLdPhk7bPpEsKIm8ZfDAxhrr04yOBcvz/KXw9ckK0qMcYw/lTGDG+x7AlXZr6OMhx2TKlbAiB5RX8 SKNRh4Zev41vk0WHsfPYjnSnuPIX6DFNdJajB9oySgN2OUTdhDrXR8EAzJ7fwXh5wWTdKYue0p3Ts Ruopw/MHzZriXrHNzUR2yUwYFh6h8uvZA//9SVcvM5IZ4SRI68jSRppkAfx1jCo3TfEd68oxahblZ H7+niTaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOY-00C8tZ-1m; Sat, 16 Sep 2023 08:11:14 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOU-00C8ps-09; Sat, 16 Sep 2023 08:11:11 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 3325DCE2C88; Sat, 16 Sep 2023 08:11:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97D41C433CA; Sat, 16 Sep 2023 08:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851866; bh=UYdXIqiINCVLLQGfe9I1Rok64nchnoCUfDXrQIlFA9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mcMw278vtPECEEuGf3HdKyPhRF6DSG87pwnP3vo4yG013oPC+Z6k3KLldIPmfTogU oGQcxeH66rohOXs72DQzon0BXUt9SFjGaplVK1PaypjmXseubOHBF3GvkOOT5TXxYm pzttMJW82kh6ZCOUxp2SYuOmb/X35fk5VfXjCzI6+cakHjmyn0gV+3pY/Kl1yBL9EB Vw9K8eWClAvTPC2hSAHQHYFEk7EESwzcCEiaCCy+ciiIoRzJoV7Xqj3L/1PsWRotq5 sG9/eN7PD/NM5NUIu86z2SrfpeFob/kKzo49Nis6398+5DJLp9FbqHNr56jTCVSgIT Dp9IdTs35FlHA== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 05/23] net: stmmac: dwmac-imx: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:11 +0800 Message-Id: <20230916075829.1560-6-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011110_439558_2680AB90 X-CRM114-Status: GOOD ( 13.87 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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-imx.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index df34e34cc14f..e5989424894b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -331,15 +331,14 @@ static int imx_dwmac_probe(struct platform_device *pdev) if (!dwmac) return -ENOMEM; - 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); data = of_device_get_match_data(&pdev->dev); if (!data) { dev_err(&pdev->dev, "failed to get match data\n"); - ret = -EINVAL; - goto err_match_data; + return -EINVAL; } dwmac->ops = data; @@ -348,7 +347,7 @@ static int imx_dwmac_probe(struct platform_device *pdev) ret = imx_dwmac_parse_dt(dwmac, &pdev->dev); if (ret) { dev_err(&pdev->dev, "failed to parse OF data\n"); - goto err_parse_dt; + return ret; } if (data->flags & STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY) @@ -365,7 +364,7 @@ static int imx_dwmac_probe(struct platform_device *pdev) ret = imx_dwmac_clks_config(dwmac, true); if (ret) - goto err_clks_config; + return ret; ret = imx_dwmac_init(pdev, dwmac); if (ret) @@ -385,10 +384,6 @@ static int imx_dwmac_probe(struct platform_device *pdev) imx_dwmac_exit(pdev, plat_dat->bsp_priv); err_dwmac_init: imx_dwmac_clks_config(dwmac, false); -err_clks_config: -err_parse_dt: -err_match_data: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } @@ -423,7 +418,7 @@ MODULE_DEVICE_TABLE(of, imx_dwmac_match); static struct platform_driver imx_dwmac_driver = { .probe = imx_dwmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "imx-dwmac", .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5548CD37B6 for ; Sat, 16 Sep 2023 08:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kvBPCM1NUNxnFxgKHqnoGsa+cnKllEgN2drWevPq1Vc=; b=PL4nBZzzb+nqsB9oEu6TyjmUDh qd4SMaFfCc4VjqB/n9Ljfi/osGjoGS5ON2NMmMPk8eme/FMC7yU+Pu4PgtuLpUdmHBvUJfi4JZvJR GlTIrvJla0g5p1vxo7cdgQy8qbOgYYZmsqApb8fRn1FDg5VHTDiqnzBieK6eYgHxD7xZFOzyZNXto JeSo8f4Djb1czptnMrgLUSYljQTgo1n8sdXYWrVXacmef64FAhq2E0HReyyd6JlkUhLola9u2S+0e Lf1KH4WwN6J7tUXGIDyo7hk5ezdvnR1z19lhXOyuVZxMtLqFTlLj7r99C7/Byud70tUkKg+FIpg0q EEuTKO4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOe-00C8xq-1q; Sat, 16 Sep 2023 08:11:20 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOa-00C8uL-1h; Sat, 16 Sep 2023 08:11:18 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 12FEDB80CAC; Sat, 16 Sep 2023 08:11:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FF26C433C8; Sat, 16 Sep 2023 08:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851873; bh=9K+bAgFgRSoe75AY/oNP9w5m5JVVUzg6VzRkj5SAnuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ljNcgs9nfQ1hLzjCiWOz6Ifb92pKkp4OSzdvFoL7LUfOfCpL1maNkY21Q7cbCnqlr XHEqxpM6O99Tf8nTMxbHFjMjR/b2o37aVO60YFYFbzFilO9OwOAiOjvR3Fmn+1bNuX ldFbj67aB8I7uScxZrCMHjMIOJzJw43ZI9z9yjC2lWhScWVSuPnz0LTJCnTfcBvVd/ syxxccX+u3r7/cAzQfut1SPK4vZPKTMSaWWZ3D782P0wffMxhR1ftl4w481v+CFPId gCzzHD6yAYkEHgL3vmxxxZ1icD947exPVoB0tri+oWOjNW2DYLPW5rtD8rnzZ0Gf+n S/vYs6MxfGbhw== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 06/23] net: stmmac: dwmac-ingenic: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:12 +0800 Message-Id: <20230916075829.1560-7-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011116_878436_E6EFF212 X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 --- .../ethernet/stmicro/stmmac/dwmac-ingenic.c | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c index 0a20c3d24722..3f87053ffc07 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c @@ -241,29 +241,25 @@ static int ingenic_mac_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); mac = devm_kzalloc(&pdev->dev, sizeof(*mac), GFP_KERNEL); - if (!mac) { - ret = -ENOMEM; - goto err_remove_config_dt; - } + if (!mac) + return -ENOMEM; data = of_device_get_match_data(&pdev->dev); if (!data) { dev_err(&pdev->dev, "No of match data provided\n"); - ret = -EINVAL; - goto err_remove_config_dt; + return -EINVAL; } /* Get MAC PHY control register */ mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg"); if (IS_ERR(mac->regmap)) { dev_err(&pdev->dev, "%s: Failed to get syscon regmap\n", __func__); - ret = PTR_ERR(mac->regmap); - goto err_remove_config_dt; + return PTR_ERR(mac->regmap); } if (!of_property_read_u32(pdev->dev.of_node, "tx-clk-delay-ps", &tx_delay_ps)) { @@ -272,8 +268,7 @@ static int ingenic_mac_probe(struct platform_device *pdev) mac->tx_delay = tx_delay_ps * 1000; } else { dev_err(&pdev->dev, "Invalid TX clock delay: %dps\n", tx_delay_ps); - ret = -EINVAL; - goto err_remove_config_dt; + return -EINVAL; } } @@ -283,8 +278,7 @@ static int ingenic_mac_probe(struct platform_device *pdev) mac->rx_delay = rx_delay_ps * 1000; } else { dev_err(&pdev->dev, "Invalid RX clock delay: %dps\n", rx_delay_ps); - ret = -EINVAL; - goto err_remove_config_dt; + return -EINVAL; } } @@ -295,18 +289,9 @@ static int ingenic_mac_probe(struct platform_device *pdev) ret = ingenic_mac_init(plat_dat); if (ret) - goto err_remove_config_dt; - - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) - goto err_remove_config_dt; - - return 0; - -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); + return ret; - return ret; + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); } #ifdef CONFIG_PM_SLEEP @@ -385,7 +370,7 @@ MODULE_DEVICE_TABLE(of, ingenic_mac_of_matches); static struct platform_driver ingenic_mac_driver = { .probe = ingenic_mac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "ingenic-mac", .pm = pm_ptr(&ingenic_mac_pm_ops), From patchwork Sat Sep 16 07:58:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78D91CD37B5 for ; Sat, 16 Sep 2023 08:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mcJuPdTT5PSeJ0r7Tit+l0BFZMdUShwV7yjDIMm2cWg=; b=1Ryk+nISwFfPHnIE9VXXdo/j7/ Q8kSSkCIuuqc4yv8JTjB1j0+tjeBbnxPHckV2xtj+Z9NaZHTYnpKQMW+8jM8HX+InbbBXpbK9PhK5 dGb3U3k0Yc83dYU5rauQnPQDz9NvyqGF6cUrOrrAkHIrOe/ZsPj+TvL6c3eeCVO3jpuFPn2wexQEf Ta6HVkVPI2ef9rrMOtjD1Wqzgkh1n+hLi53tVTh8OI+cUZWLYvXi98zpZDxuA3HeeXvOWWYsAlT5I y3MBMiw8NGPZgEdTAZ2160oSHUE0aJYHbXKzxaXQ78ikv53GmEROWBU23pNYycSunXqhHKEOQyZWj yUne/ZHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOm-00C935-1O; Sat, 16 Sep 2023 08:11:28 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOi-00C8zs-1V; Sat, 16 Sep 2023 08:11:26 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id A4E35B80AC8; Sat, 16 Sep 2023 08:11:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29C86C433CB; Sat, 16 Sep 2023 08:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851881; bh=oTujxMOHFGRuGKFiieFc6dhpH7GYKf8q7WqlAEbZzVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JmxWxAvQ9UJkjuq8H1uiO7GEaoC5WjEDdnkpggAIHHjS/RCKj+q3y6EondR7Zk1E9 g8wg5HTU8zlVHZezJyEyVq2j/2OTm/XahnDNqQdxoBChPySTEB8vs4xQ+9vc+x3nEY LmGqQQy/8bIRXmcZZkMa6kGZqrPvTsGO0XLvzOicIclNT9luPVKo99/g1i0HvAyHVn eX1o1AZnvJYbH5m8qQgzQgUHRruCBUcDCTKDvqO7vuTXtMr0epbTqJLk9HEroLZAKy yRlg4TCzJNKp/4z8vmcyhAuTeHA6HhxQiuYUZnFnIXr1QnydHuFUNDDOG+/rvs/FqL yy0teDzDICxBw== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 07/23] net: stmmac: dwmac-intel-plat: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:13 +0800 Message-Id: <20230916075829.1560-8-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011124_812904_B7FECA52 X-CRM114-Status: GOOD ( 13.47 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 --- .../stmicro/stmmac/dwmac-intel-plat.c | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c index d352a14f9d48..d1aec2ca2b42 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c @@ -85,17 +85,15 @@ static int intel_eth_plat_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)) { dev_err(&pdev->dev, "dt configuration failed\n"); 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; dwmac->dev = &pdev->dev; dwmac->tx_clk = NULL; @@ -110,10 +108,8 @@ static int intel_eth_plat_probe(struct platform_device *pdev) /* Enable TX clock */ if (dwmac->data->tx_clk_en) { dwmac->tx_clk = devm_clk_get(&pdev->dev, "tx_clk"); - if (IS_ERR(dwmac->tx_clk)) { - ret = PTR_ERR(dwmac->tx_clk); - goto err_remove_config_dt; - } + if (IS_ERR(dwmac->tx_clk)) + return PTR_ERR(dwmac->tx_clk); clk_prepare_enable(dwmac->tx_clk); @@ -126,7 +122,7 @@ static int intel_eth_plat_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "Failed to set tx_clk\n"); - goto err_remove_config_dt; + return ret; } } } @@ -140,7 +136,7 @@ static int intel_eth_plat_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "Failed to set clk_ptp_ref\n"); - goto err_remove_config_dt; + return ret; } } } @@ -158,22 +154,17 @@ static int intel_eth_plat_probe(struct platform_device *pdev) ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) { clk_disable_unprepare(dwmac->tx_clk); - goto err_remove_config_dt; + return ret; } return 0; - -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; } static void intel_eth_plat_remove(struct platform_device *pdev) { struct intel_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev); - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); clk_disable_unprepare(dwmac->tx_clk); } From patchwork Sat Sep 16 07:58:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388174 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38D15CD37B7 for ; Sat, 16 Sep 2023 08:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9OTT+JZ8B5AZP/dk95WZNBIxvAsigYYj4rOJQjlZFGw=; b=DnyM+lG7alJnTjkI9Ic8I6aW9k Q3fffwCnk0vJ5KS+yJpVY9OKIZp3tGuN3Z8rbBZWFHkBgg7yHyRxqrm4oTuUQk73QvoEIlZkvApNj XAnj85iqcflpz8/mWrRCggAAz5RcLW3LvgpGU9GlYwpeZ06imB1Neb1GV9u1ZvXXCVi/S76xsnQl6 egsRNu3lmfILHdwD0xJKzLJhKg9gN/HWu/rv/4vLC90Fs5gZPZAwsnwJRdgn9PFiKNrL2WaBAXVzC xbRDi5yIate4LChO6IQbYQczYBBHikgAFZAwLcgKGwixSoeSWvBayiRyY5fesMjjVXzoeIgjVqffF a4injSXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOw-00C9A2-2k; Sat, 16 Sep 2023 08:11:38 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOs-00C95m-1A; Sat, 16 Sep 2023 08:11:36 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 7DBB5CE2BD0; Sat, 16 Sep 2023 08:11:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6093C433C8; Sat, 16 Sep 2023 08:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851889; bh=08rPVmjgSTC5liiFw2rBYcil6Ema5CtgYx2svnPVZ9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJ+Cti+Eoi31M9upPtCd/V3Dy9zjfLqjLJ8ymW2fPjh3cBGsvwyt3foSM3X2Lvzly F176DdkyuaiJyVeZ8YbAR9fPZtBC0kNTQ3dXyJaWzx++9eQwalLawksMYzretBdns7 A5NDFD6A0e2Mhjok6m03ntOhIVBzkChFkTqJNmkf0RYPtkGQkRqRwoXkpJClV/Bjo7 m4mSN5aTce7zZzV5AaeZl9qkegCjOlLbzr62jtcNwF+E4IwcquAbtF6VSGdcrGf6PB ZZbseIbpKwKyV7+hg0Vs4UZ3QNHsXgvxZ49SfUAizzvgEDd8J7182hfOT3CTScLsS8 4OqTv6K7FtJxg== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 08/23] net: stmmac: dwmac-ipq806x: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:14 +0800 Message-Id: <20230916075829.1560-9-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011134_757986_678D2BE3 X-CRM114-Status: GOOD ( 15.35 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 --- .../ethernet/stmicro/stmmac/dwmac-ipq806x.c | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c index 9b0200749109..a9916fd07616 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c @@ -384,22 +384,20 @@ static int ipq806x_gmac_probe(struct platform_device *pdev) if (val) return val; - 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); gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL); - if (!gmac) { - err = -ENOMEM; - goto err_remove_config_dt; - } + if (!gmac) + return -ENOMEM; gmac->pdev = pdev; err = ipq806x_gmac_of_parse(gmac); if (err) { dev_err(dev, "device tree parsing error\n"); - goto err_remove_config_dt; + return err; } regmap_write(gmac->qsgmii_csr, QSGMII_PCS_CAL_LCKDT_CTL, @@ -459,11 +457,11 @@ static int ipq806x_gmac_probe(struct platform_device *pdev) if (gmac->phy_mode == PHY_INTERFACE_MODE_SGMII) { err = ipq806x_gmac_configure_qsgmii_params(gmac); if (err) - goto err_remove_config_dt; + return err; err = ipq806x_gmac_configure_qsgmii_pcs_speed(gmac); if (err) - goto err_remove_config_dt; + return err; } plat_dat->has_gmac = true; @@ -473,21 +471,12 @@ static int ipq806x_gmac_probe(struct platform_device *pdev) plat_dat->tx_fifo_size = 8192; plat_dat->rx_fifo_size = 8192; - err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (err) - goto err_remove_config_dt; - - return 0; + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); err_unsupported_phy: dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n", phy_modes(gmac->phy_mode)); - err = -EINVAL; - -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); - - return err; + return -EINVAL; } static const struct of_device_id ipq806x_gmac_dwmac_match[] = { @@ -498,7 +487,7 @@ MODULE_DEVICE_TABLE(of, ipq806x_gmac_dwmac_match); static struct platform_driver ipq806x_gmac_dwmac_driver = { .probe = ipq806x_gmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "ipq806x-gmac-dwmac", .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68AFFCD37B5 for ; Sat, 16 Sep 2023 08:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DVcdvnJRAJp1Ni4EKpUpkZNfcGpDLD+VJ1jY6Gh9UWM=; b=HudXmudlO/i9FVALCDZupgTgn9 IiVavCIh/0lc3+5XvbUZ/p7JCkGiifHOMzY+K/r8SgkAINxMvverrrpvLx1QjrmBOuIcDER7r5kGh cQJ+VH3WTnfTDFVjYnkjta/c9rcoOceaKx3kagFV26u5pTVNVvrUpVIZTlA62vAGtZRgDDUIx5KGW 1DJijvdhSFNLB3RMLO4Mpy3jeAjS/ljY10d+ozJgiLE4RwWx6xiY7163yQWZ0TiAfXiJe/V4gjWbH JQuwr4B8yjRzmuQ+29bNyiy7rNMbDQeBJLIM+DVJ9+fZDSWOHbKzMS+FhjgPwbKY/Lc5j5Qa6LFN2 hjeBV/eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQP4-00C9Fa-0G; Sat, 16 Sep 2023 08:11:46 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQOy-00C9Ac-1e; Sat, 16 Sep 2023 08:11:42 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 66BCCCE1D31; Sat, 16 Sep 2023 08:11:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9109FC433CD; Sat, 16 Sep 2023 08:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851896; bh=k+EgMO48VJPl+HjO+Hwx9k/pRjhpwRrvBBp+z5uHuOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gGjbG3NcBcZIJ7tpqtuZoL2zZNoxErWFHC0rmmQ/60zEcbA4EttoGPMInsTX7b1K5 4D1FOAO6FgVfC/lI8ByZrdzDQAiA92qADKiKGEsjpGEa9IVSJNBn8d56BeFaiaIjs4 DJFZ0kSEzpV3NdGhGG8VZIij65keerTrL2dsKophdQw+W9OLd4YG4lzTsv+xknAl7G 3Sal9uC3mIVctoO1DsgUVYQpv9yyNCODVkF9KnTX9dgDGVub1tuo8vngrNM44WfyY5 MIuqRF9SOV/RrTuDKzMUwWLOCGtn8p2D/4rNOXMoxgyYh1V4vVRV/kSuI1z4MQ3una 6eiX8kywOVmww== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 09/23] net: stmmac: dwmac-lpc18xx: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:15 +0800 Message-Id: <20230916075829.1560-10-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011140_897763_7692ED7A X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 --- .../ethernet/stmicro/stmmac/dwmac-lpc18xx.c | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c index d0aa674ce705..dad23b47f383 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c @@ -37,7 +37,7 @@ static int lpc18xx_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); @@ -46,8 +46,7 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev) reg = syscon_regmap_lookup_by_compatible("nxp,lpc1850-creg"); if (IS_ERR(reg)) { dev_err(&pdev->dev, "syscon lookup failed\n"); - ret = PTR_ERR(reg); - goto err_remove_config_dt; + return PTR_ERR(reg); } if (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII) { @@ -56,23 +55,13 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev) ethmode = LPC18XX_CREG_CREG6_ETHMODE_RMII; } else { dev_err(&pdev->dev, "Only MII and RMII mode supported\n"); - ret = -EINVAL; - goto err_remove_config_dt; + return -EINVAL; } regmap_update_bits(reg, LPC18XX_CREG_CREG6, LPC18XX_CREG_CREG6_ETHMODE_MASK, ethmode); - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) - goto err_remove_config_dt; - - return 0; - -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); } static const struct of_device_id lpc18xx_dwmac_match[] = { @@ -83,7 +72,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match); static struct platform_driver lpc18xx_dwmac_driver = { .probe = lpc18xx_dwmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "lpc18xx-dwmac", .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388176 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2267ACD37B5 for ; Sat, 16 Sep 2023 08:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lWx2SPTa6kheNdS6Ewo22+0/9zyKhBXS1nee5Nal+ME=; b=Z+uvapnSCAkVucsalYZ8X/VmNy D2Bftt+6466FITTKe7T0TZ2Zxf1w9amSdBJPtBx+rV0dXY1p5HPcX9sLjQzk4PGEDNoyyg15qtFFx pYyy8CCNnRaobZ7x4jLqTA6X46y6Sxsbrn/1NuZrVxVPUHcUI7S5MECYv8ABXfQTcKpTdI+euzVWZ w2hmKUpU6YNGsX8vxg2QkzONY027q9FzkzVe2yZSZya4J4vX92I7Ocrins6mtKsyJAa1EziV0oDH4 EqHkGY99j6DpIvxUwN/MB/M090At9c0Jgzc1gW+mFjrARdkMduOt6ZPVkwVxY2B+aXrTYsa3kATrE 3i/cE39A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQP9-00C9K0-3D; Sat, 16 Sep 2023 08:11:52 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQP2-00C9E2-2E; Sat, 16 Sep 2023 08:11:46 +0000 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 18E3860AAF; Sat, 16 Sep 2023 08:11:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A8EAC433CB; Sat, 16 Sep 2023 08:11:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851903; bh=suO+8eIztFCZlwSD7uqirMgAu/b9k2nFDN75QHwxBD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGeoc3XoBZL8cc3sfZZH/HKjz3P8JT7A7MD9eBbBq8uuOhwjSVLoYoCr3q1VEdLYX W9heWbbUKiqMPN4cviVdUNYpFAU8F5GAL1YOe/GVFJOFqxfD0Aptk5cNgfnL/NcL/8 UIicHoxn0GQujien1GTKeUk0olmirGcx6cuswT4l/Fu9LMV/W7HFt8sYpYlj+ffA7v 84PUFRZgd5yeYpl5hyByQdjPi6tPTHr0iLJlvmcUZdNeIHJBNouiWlUX3XQmXjnrmI RvnW3jKyuN4Kswgu9CYCRLrv6sIYDY5T5LCZ8jwvQ7reocrGfs4Wnp5W4s5XYj3Z5n bxzx2RkLNzkJg== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 10/23] net: stmmac: dwmac-mediatek: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:16 +0800 Message-Id: <20230916075829.1560-11-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011144_836401_38E0E18C X-CRM114-Status: GOOD ( 12.96 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 cd796ec04132..11976a854240 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); } From patchwork Sat Sep 16 07:58:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE1BBCD37B5 for ; Sat, 16 Sep 2023 08:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qfKu+/bnqYHOtnVeyPl0mBacMAK/u2PsFV/2pwS2GBA=; b=h+CJARRaAzE74aNPlrmLe5RAxT mV6i3PvC7qzwG7/fRpzYudjo8sj7qLUXoB4JV7LUyIUnlCWWEoGs0xtP+V9QlGblfiTTYwAAzf+H9 jZAiQwvyvQo1w9XnmGkxhOuTd1KONtAHQpHhmWRCgQhJSR1SOF+Q3wjDgt8IJoLG7eHRlbfKvHQha mX61PdJdtHNffEeYLEgQj0nKZgrH5l0jQQRKOddyCWILCxVGas1FAfJnQq/VMKHFugeTW7zJdz096 1kxPZ31SP14JMHGlkts+MsmmUouYbjpds0c1Sluqcjt7smjZwg6DyYGGJhYN34dR0o9NA99pWEwAN Lx+XAStQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPD-00C9NG-1r; Sat, 16 Sep 2023 08:11:55 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQP9-00C9J5-0K; Sat, 16 Sep 2023 08:11:52 +0000 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 8BBB660AEB; Sat, 16 Sep 2023 08:11:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF05BC433CA; Sat, 16 Sep 2023 08:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851909; bh=9zmrYjn6LWQoCN8M+Pfq1cMEVS3X4afFI5xUTUylk9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CX63MbhgBXijRNxl5rMjlNjQ/jBtGRjT5WqqEc8zXITOOOoyjA6mPKNHIQkT0Rn8W L7nqt9dXrEq5AZ4UuxSjBl7rQt3VV0rE5SP5c0h3O0AF59IF1hAcC7MvspnvuHknje rjx+zH3bCsqOEGyNBpFs0zSfcpPGpAF26+Tfp9LQumQ4ncOYWv1jv1ihUAAHm5j1L+ bJY2IcF6KasBuh6R0/hhRwNSWyciOFWVpvK+cqtmRb5Tu+XTzNq9W618iqGAIP5Zwm X94c7pm/h3t2aXxsRxoEno37aWxVp7eK81XPwYDu5Rtj6VyQZ+Bx02jWSV3o1xyst0 LoxQLvs0CrpkQ== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 11/23] net: stmmac: dwmac-meson: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:17 +0800 Message-Id: <20230916075829.1560-12-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011151_226174_151AE6CA X-CRM114-Status: GOOD ( 14.79 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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-meson.c | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c index 959f88c6da16..3373d3ec2368 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c @@ -52,35 +52,22 @@ static int meson6_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; dwmac->reg = devm_platform_ioremap_resource(pdev, 1); - if (IS_ERR(dwmac->reg)) { - ret = PTR_ERR(dwmac->reg); - goto err_remove_config_dt; - } + if (IS_ERR(dwmac->reg)) + return PTR_ERR(dwmac->reg); plat_dat->bsp_priv = dwmac; plat_dat->fix_mac_speed = meson6_dwmac_fix_mac_speed; - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) - goto err_remove_config_dt; - - return 0; - -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); } static const struct of_device_id meson6_dwmac_match[] = { @@ -91,7 +78,7 @@ MODULE_DEVICE_TABLE(of, meson6_dwmac_match); static struct platform_driver meson6_dwmac_driver = { .probe = meson6_dwmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "meson6-dwmac", .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 841EBCD37B5 for ; Sat, 16 Sep 2023 08:12:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vCt/jPuVskrFpdgPGOBO4Cqq+OLtK9HA44FFfUUmuQg=; b=hunUDFGPo0UlJPPHO8YU6XvzsR kIG4+Z1UPZn3HxOT8W1st/FS2unoP+8DHRN8AjWG45I+WMs63SW7/PferBKIh4kYIX8U1jLmdcN63 Wti14SX+al23jujqnqF0Bxks1WOYdcMVO0/WwkwzPidxb3f78hIHduN7Kj6nyofEbxqMq09DWyOTn 15aoiTkW3jIBMwJBuDG7ygBqUxRbY5tJG8EjrL9vNXXlIJEOtgqGjXt+7Pxr6wGWwNbPOKsbDqaU9 HXF1UlYAuh5xwfsaCui8jNM1581oRC6BxO4AVyQZbFHhcD1IROjNecTgE8KTZPtKN1ezgBi10JIvM rtgvqA6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPN-00C9VR-0Y; Sat, 16 Sep 2023 08:12:05 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPI-00C9Qs-0D; Sat, 16 Sep 2023 08:12:01 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 1AB25CE1D31; Sat, 16 Sep 2023 08:11:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E41DC433CC; Sat, 16 Sep 2023 08:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851916; bh=isFMv5J3rpOHLVDhhNbIoTnhkQjoG9ObXVsYmwnSTWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J8Dujy+CQpnn20jOp4hfFCrL0YMWPTrkPx9UkZC0mGwmsD581rKr8waQDUEiJymJM LF1FQ1gE9T6HbjfLot3zV+of7uE6E/pEmZ9eLTdV3CJ6W1rVeFDbNu9wEf4LCpNlUN 9apO353t7HkpmQ4zHf0TY1E4gYHIJZIEsqhGiSswJMKIOPKd4LQjrQZJ2kEVz/fGum SSwFsmFnB3mPyjZ0tLDDCwkHJYnY4Kg3JRc7wNCEoCtMDPXd+lYmfHqHZ6V4IDfirS D/heg3pY6tEx7VOuPsVmoSX4vsiblGAA9Wq9sKiQMW8/4qDX/ieAwK1znNJtQKn2ar y9xudAthRcg6A== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 12/23] net: stmmac: dwmac-meson8b: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:18 +0800 Message-Id: <20230916075829.1560-13-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011200_455858_6BABEC49 X-CRM114-Status: GOOD ( 16.25 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 --- .../ethernet/stmicro/stmmac/dwmac-meson8b.c | 55 ++++++------------- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c index 0b159dc0d5f6..37f249980929 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c @@ -400,33 +400,27 @@ static int meson8b_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; dwmac->data = (const struct meson8b_dwmac_data *) of_device_get_match_data(&pdev->dev); - if (!dwmac->data) { - ret = -EINVAL; - goto err_remove_config_dt; - } + if (!dwmac->data) + return -EINVAL; dwmac->regs = devm_platform_ioremap_resource(pdev, 1); - if (IS_ERR(dwmac->regs)) { - ret = PTR_ERR(dwmac->regs); - goto err_remove_config_dt; - } + if (IS_ERR(dwmac->regs)) + return PTR_ERR(dwmac->regs); dwmac->dev = &pdev->dev; ret = of_get_phy_mode(pdev->dev.of_node, &dwmac->phy_mode); if (ret) { dev_err(&pdev->dev, "missing phy-mode property\n"); - goto err_remove_config_dt; + return ret; } /* use 2ns as fallback since this value was previously hardcoded */ @@ -448,53 +442,40 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) { dev_err(dwmac->dev, "The RGMII RX delay range is 0..3000ps in 200ps steps"); - ret = -EINVAL; - goto err_remove_config_dt; + return -EINVAL; } } else { if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) { dev_err(dwmac->dev, "The only allowed RGMII RX delays values are: 0ps, 2000ps"); - ret = -EINVAL; - goto err_remove_config_dt; + return -EINVAL; } } dwmac->timing_adj_clk = devm_clk_get_optional(dwmac->dev, "timing-adjustment"); - if (IS_ERR(dwmac->timing_adj_clk)) { - ret = PTR_ERR(dwmac->timing_adj_clk); - goto err_remove_config_dt; - } + if (IS_ERR(dwmac->timing_adj_clk)) + return PTR_ERR(dwmac->timing_adj_clk); ret = meson8b_init_rgmii_delays(dwmac); if (ret) - goto err_remove_config_dt; + return ret; ret = meson8b_init_rgmii_tx_clk(dwmac); if (ret) - goto err_remove_config_dt; + return ret; ret = dwmac->data->set_phy_mode(dwmac); if (ret) - goto err_remove_config_dt; + return ret; ret = meson8b_init_prg_eth(dwmac); if (ret) - goto err_remove_config_dt; + return ret; plat_dat->bsp_priv = dwmac; - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) - goto err_remove_config_dt; - - return 0; - -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); } static const struct meson8b_dwmac_data meson8b_dwmac_data = { @@ -539,7 +520,7 @@ MODULE_DEVICE_TABLE(of, meson8b_dwmac_match); static struct platform_driver meson8b_dwmac_driver = { .probe = meson8b_dwmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "meson8b-dwmac", .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C97ECD37B5 for ; Sat, 16 Sep 2023 08:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7w7h0lxk1t21eFOi9jZPaBYQeLyrd9sxN8nlcFvFA2I=; b=FCtkT20FJSEMn9nWZ8BBSMIRto fb6uib38511ljTbq903FuCszzjOzA/xFYKGOf6Qcq5G5IQ0MJ31sMN41/BlpnpiXD1tDWVDjFbe4G vd44WZjiERIdXgDToNzIKFZX9+C/8r7Bf3UxgeFeDxXw9vSIRX/ag+oIkP/WeYfHbwhcAi12NH3zd XHuxSCVUeOkKj7sGHJOFEU7xVWgYznMeKXUegLPagkKv6xOV8HFyVOT7OhvITwhp5AqwkDWrdnnQy 1lJri+nEOXpc6bQf1+r2TtqCf/PnOjBRApbzZQtN8jMAfrVmnwVszNSg8nmep4l+eUaMvFD7wWmxt 0YY5AWsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPU-00C9bO-05; Sat, 16 Sep 2023 08:12:12 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPQ-00C9X3-0Q; Sat, 16 Sep 2023 08:12:09 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 5F23BCE2C88; Sat, 16 Sep 2023 08:12:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3E3AC43391; Sat, 16 Sep 2023 08:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851923; bh=QnUj2UcWjwSt/r3IooG168fCs/+hvc8TMJRfrlPuAhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CzD1kc6YyYKRCxIo6So1taAA0DUd7gek1Y3uNl0Z2NgX/pa3f+ymKB2uPvloicRQb lzwKMNpWXNCWSB+f0LUEFEK4ZF4blpGPX9fx558wrMhcL10muodo5lfLnE8jSPYyN3 XP/MAnsO/Ec5a67YaeQ9ofa1vQRlMs9SLJ5kQbB5IhbFGq2aW4TLqJa7y4D0gIzO7S pvHWGsbbh8oWEhZgvG+hhctY8ZZRZqO1umeKhFeD2WA4l4LxwSN/Wmz+z0mCIPp2Xf NDzO378fgWsjoU6boFTP5GZcD5js+6NhVVjF7i6diewBSkii96uIwkz5yTBcjfnuGT AxywFClOptu6w== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 13/23] net: stmmac: dwmac-rk: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:19 +0800 Message-Id: <20230916075829.1560-14-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011208_528635_C3D2A64B X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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-rk.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index d920a50dd16c..382e8de1255d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -1824,7 +1824,7 @@ static int rk_gmac_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); @@ -1836,18 +1836,16 @@ static int rk_gmac_probe(struct platform_device *pdev) plat_dat->fix_mac_speed = rk_fix_speed; plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data); - if (IS_ERR(plat_dat->bsp_priv)) { - ret = PTR_ERR(plat_dat->bsp_priv); - goto err_remove_config_dt; - } + if (IS_ERR(plat_dat->bsp_priv)) + return PTR_ERR(plat_dat->bsp_priv); ret = rk_gmac_clk_init(plat_dat); if (ret) - goto err_remove_config_dt; + return ret; ret = rk_gmac_powerup(plat_dat->bsp_priv); if (ret) - goto err_remove_config_dt; + return ret; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) @@ -1857,8 +1855,6 @@ static int rk_gmac_probe(struct platform_device *pdev) err_gmac_powerdown: rk_gmac_powerdown(plat_dat->bsp_priv); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } From patchwork Sat Sep 16 07:58:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 299BFCD37B6 for ; Sat, 16 Sep 2023 08:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OdvIZ8tF41Wvg173bi3t0qZulz2rh8VpJNhv9w399IU=; b=c9h3BZzAW0cC4Sk//mbID/iJcX useFhROG228AErfv2cXWpxRlWE79KzHQMIGPF9UbVOoJiRtYw+BoNZjBaMbY6tth8ro0vMsx9CoQU THb/Z13l4yP3LXpEHHiuQghr2rS7Lus2Q4nNAWwDUJfujefu4cybvJnq/ghujeHG4mUl9JbXbq5n3 1bShbnU+tqwUfMff294x/k+IpoDmdElBwXl/rxcI80PzsEbQoIHy2YewX/wgKNHTBsCxd+RnY8B2E cwjIfAkuI3QBZq09cPSlWRCAtLisH+XlzQnX5qHLq0jt0jVjtCD6SfL9k7X4DfFfi8KkdQmEy4PAQ GRJahpbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPZ-00C9fO-06; Sat, 16 Sep 2023 08:12:17 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPT-00C9aX-2C; Sat, 16 Sep 2023 08:12:13 +0000 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 26DBD608C0; Sat, 16 Sep 2023 08:12:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 181DEC433CA; Sat, 16 Sep 2023 08:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851930; bh=YmboYqxdl0thrb4XWc4/zOz9FdEZLOtHhduc2bzg0Lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZXk0eNYb/PX8/VUpZLIpmpUyHghY9JkGOmkOQq4oex1qaTWzWTbh4CVhx8JL0ztd MYBLv4UQl9YWiUD5jZ3imMF+HXiLMcOsNcyhneSkJ/N6vt5Qu8X6vThjoBJG8um1ws Qm15l03Pf/vgCCrS/YEDQUUJvozNrH2yJ0gZ6wpq3mFVIn8eD6e/RGkeagXWtrvae3 cbmdFZZQMwxWNUD8UmURuFl4vynpHNUOmu3heWKe8P+Nd/ylIsFJBF6CImPZM5Dac2 B5Kt+V7Orb2W2Fj2eiwINdednf2ACJvvMhnJP1OkQttjH1QHjW1hsrk4RUkb8Kw8ZW UgewWneZ5Qj1g== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 14/23] net: stmmac: dwmac-socfpga: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:20 +0800 Message-Id: <20230916075829.1560-15-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011211_827991_D7B3F9C3 X-CRM114-Status: GOOD ( 14.03 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 --- .../ethernet/stmicro/stmmac/dwmac-socfpga.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 9bf102bbc6a0..03e7701d0186 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -400,21 +400,19 @@ static int socfpga_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(dev, sizeof(*dwmac), GFP_KERNEL); - if (!dwmac) { - ret = -ENOMEM; - goto err_remove_config_dt; - } + if (!dwmac) + return -ENOMEM; dwmac->stmmac_ocp_rst = devm_reset_control_get_optional(dev, "stmmaceth-ocp"); if (IS_ERR(dwmac->stmmac_ocp_rst)) { ret = PTR_ERR(dwmac->stmmac_ocp_rst); dev_err(dev, "error getting reset control of ocp %d\n", ret); - goto err_remove_config_dt; + return ret; } reset_control_deassert(dwmac->stmmac_ocp_rst); @@ -422,7 +420,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) ret = socfpga_dwmac_parse_data(dwmac, dev); if (ret) { dev_err(dev, "Unable to parse OF data\n"); - goto err_remove_config_dt; + return ret; } dwmac->ops = ops; @@ -431,7 +429,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) - goto err_remove_config_dt; + return ret; ndev = platform_get_drvdata(pdev); stpriv = netdev_priv(ndev); @@ -492,8 +490,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) err_dvr_remove: stmmac_dvr_remove(&pdev->dev); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } @@ -504,7 +500,7 @@ static void socfpga_dwmac_remove(struct platform_device *pdev) struct stmmac_priv *priv = netdev_priv(ndev); struct phylink_pcs *pcs = priv->hw->lynx_pcs; - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); lynx_pcs_destroy(pcs); } From patchwork Sat Sep 16 07:58:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFC15CD37B5 for ; Sat, 16 Sep 2023 08:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2FZXa3FdPjvssuSNAYpzOh4yyHOuB3rniPQ7va2LSKw=; b=aLlTRUsiZTxUcBmuCXluaQz8CJ dWDw7DLwDqKTsj42uUX2PNPe7qD5dZ5Kii5qpmO2TarC0YgCryhMbd68+hWJLITx7/M4/2/7+Lrkf h5xFxBFySDdRoRNF4xJGjZ07XJA7V1/6B5kl2N5iiPirJnbNcnvK5g0OpuvAjRcdnJtu1lI2kQEzn 3MijUl4sRzPZpNwGFipRj06Sd+qXx2DW1wahHJg1XAKJ93TLX/hGtXR4qEhMMVAn/ZgLzHtwL8+S2 gfdE7d91rLxoXGs3hOOKBxK3XnmNSMAMJyREUJcxyPsB8e1OL2YCfgoFJpDm0dr86IyXzaWumAR+w echy49ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPg-00C9ld-1G; Sat, 16 Sep 2023 08:12:24 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPb-00C9hG-1t; Sat, 16 Sep 2023 08:12:20 +0000 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 0A48F60ABB; Sat, 16 Sep 2023 08:12:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7670C433CC; Sat, 16 Sep 2023 08:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851938; bh=DKEvP3IapJYTsAbn033GPqYVOiEf5sbsPE67h+G6Mqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rMur2taxkAcQGcr/Nn3XDMCGpecz6RS6VoYgg4Deagg84YSPeo41Gc2Uo0fLn6xpf 9z8sC4/VNHpCivd2zB8pqggwYd911uKpf/cVt1Jsy3D4uHqD3ytevG8b/Y1fx4qeXw qhnaDvpQ4UwUegJ28+CSRnvj+OeDVr09S8QVRp1vflARUU7EF0lID3UG+H40XOKmQD NolZtcM9MDO0mTRW0TXg4yyTQTZWQ5ggFJLLnAoUb7sBY8Pwhf514q3GE0AlIvExqc xuSo68Ee7mxPoSmn0seGpVJBQfm8wafAEOoU4/FupoAGuAsFvQybj4Wt6r7KE7uMuf zRx2TMsWJBJAw== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 15/23] net: stmmac: dwmac-starfive: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:21 +0800 Message-Id: <20230916075829.1560-16-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011219_722900_3D7EA1B8 X-CRM114-Status: GOOD ( 14.27 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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-starfive.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c index 9289bb87c3e3..e87b4d335c72 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c @@ -105,7 +105,7 @@ static int starfive_dwmac_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, err, "failed to get resources\n"); - 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 dev_err_probe(&pdev->dev, PTR_ERR(plat_dat), "dt configuration failed\n"); @@ -141,13 +141,7 @@ static int starfive_dwmac_probe(struct platform_device *pdev) if (err) return err; - err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (err) { - stmmac_remove_config_dt(pdev, plat_dat); - return err; - } - - return 0; + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); } static const struct of_device_id starfive_dwmac_match[] = { @@ -158,7 +152,7 @@ MODULE_DEVICE_TABLE(of, starfive_dwmac_match); static struct platform_driver starfive_dwmac_driver = { .probe = starfive_dwmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "starfive-dwmac", .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E704CCD37B7 for ; Sat, 16 Sep 2023 08:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+V2zt1Fq/mIsCRLrslLMxOJaDJjzmBiZLDl5kNRhkLk=; b=cFfW06YAzT+pgPUqJrmkZ+moFw b6mhDjKvSgdH0CQXPJ41PRf+8YCwsICp3wNopwu+N95y5o6nidVOUOOZoixw2mwVVlMa8Y3Jh3KGj syztVoSt+Jo/aGYQvQGlLcOXte4YsJcEttJ7WCyQeD2m2/fk0XvI7lXqv79LKWX/6Fa3ZdD8RhFIq 1pb79IUkBmW02gT57PMGLaefdxsqQKjQyWLTBzfOBx1m5CVkPlpdbuyOmAQULeorwLFMWUNBSw11E GOgIsNE027sM1kuiINlf8Qo0KnmP3Dga/xSTPt5gtNcOC+Q1wviA7Ncmrwn6ZqDDupxwxHrS4Vg2M cyAU1UQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPo-00C9t9-24; Sat, 16 Sep 2023 08:12:32 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPi-00C9nP-14; Sat, 16 Sep 2023 08:12:27 +0000 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 CD33960AAF; Sat, 16 Sep 2023 08:12:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1809C433CD; Sat, 16 Sep 2023 08:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851945; bh=pwxVh7O0mYqw2Ljn4tWnXFw2NWOIpp5wpRx6GKnF3MQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e6vmNeEho7f/29mMl9USm28gLe72oRfimQLLra+JREzOWdEWz0f35mgbt/MgdYtFO Zd1v0PDZXM5KOtc/FNL4PS8ei18B8nJwEZmlOJq11PTOBmRx+uzs9VLKIrFtLFKm9v FhEKtwgvyPZWlWDe1uBvI4ZHPFqRgZsaEJP+PjAjDHN1ImOSkRhGI9WRq2Drq1atGO bAhpkGvPVToy+Eu/yge2gYmKZK8raCy2/9sTkeo7u+NBuiA5vanKaW6BfbsdrMoUdf hTKqjioGt1lcO5RT2Vlp1cL/b6Oave+4yEo7zgI+rvo7XSx0bpYaKmfIobqnufuDb+ fvOfSI3MhcitQ== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 16/23] net: stmmac: dwmac-sti: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:22 +0800 Message-Id: <20230916075829.1560-17-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011226_467637_B86075D0 X-CRM114-Status: GOOD ( 12.60 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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; } From patchwork Sat Sep 16 07:58:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19566CD37B7 for ; Sat, 16 Sep 2023 08:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mTQ8EZUBSwtsi+L+RbJPEuu7z7WDUNwtSUIesbYcj5c=; b=H7RvWOityyPoo0czrl/fasCRoA 2pKCrpP+mFj/dpPXGk3EYoIMsdrM99btfrBHO53OtjOSyVWoLZ9OSGCS2nLz8jiJzuOXp2qhx8SXm rLlScTQ9wBHDG8HeELV7dG8DPa9p40M31iNaSV1RkNkbKAItP/5pNbTuRA/QWN0oaCyqmqsdyHGDB lygQsLdpNG4sfiBT5unLF7M+3kEledGr4c+Llxek5Kcpi8t6VK+7GuNzgEF3qeOZwFY6isP/zmYxy rhb+/QgTrarIWmYRYxRuUDjRz0V/GLX/4tPHSm4shbSGeXoVSDBSlA/pGIMtq2pCv2LFRwKo1XIsH CfquZH+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPu-00C9zH-3D; Sat, 16 Sep 2023 08:12:39 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPq-00C9tz-11; Sat, 16 Sep 2023 08:12:35 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id E6162B80AC2; Sat, 16 Sep 2023 08:12:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FA1DC433CA; Sat, 16 Sep 2023 08:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851951; bh=DVz+nB8IvJqLf9Cq3iqAIJu8nG0D+BltvLR73sQ0FZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tqQi4l3gKamyFboFFuqRRarjM3pBQv0SYmxFUubNe9E/38XV8jubhV32c8CSdulmn 3S/2f0zO0l5A8dA7JivgOlqsGxrv+gdxZTWoFAg7d4fDLDOXGc4Jhhj/9fOJnvWh/y /3n7V1gEdN/DxJusPP3eDX+CmhRodrFxEMiGJFVKWNgYXv1HJ7stuAS2Nj7l9+0lGr C22lw/Taeh7UDWv9/jJj5YIr4LOIMhNte5sgbFz0qylskwGx1rQ2Wm9RcYiEHibBxW OpGj6j9VMQaJcPyltsfUeUCGnc6WnXZliKPi9dxgEViwNl8mQhEJUVw8KOXSHbVd6z IhQYOdnmBIiTA== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 17/23] net: stmmac: dwmac-stm32: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:23 +0800 Message-Id: <20230916075829.1560-18-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011234_652007_A502DD84 X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). Signed-off-by: Jisheng Zhang --- .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index 26ea8c687881..ab4324ed46da 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -370,21 +370,18 @@ static int stm32_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; data = of_device_get_match_data(&pdev->dev); if (!data) { dev_err(&pdev->dev, "no of match data provided\n"); - ret = -EINVAL; - goto err_remove_config_dt; + return -EINVAL; } dwmac->ops = data; @@ -393,14 +390,14 @@ static int stm32_dwmac_probe(struct platform_device *pdev) ret = stm32_dwmac_parse_data(dwmac, &pdev->dev); if (ret) { dev_err(&pdev->dev, "Unable to parse OF data\n"); - goto err_remove_config_dt; + return ret; } plat_dat->bsp_priv = dwmac; ret = stm32_dwmac_init(plat_dat); if (ret) - goto err_remove_config_dt; + return ret; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) @@ -410,8 +407,6 @@ static int stm32_dwmac_probe(struct platform_device *pdev) err_clk_disable: stm32_dwmac_clk_disable(dwmac); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } From patchwork Sat Sep 16 07:58:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388184 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4FD3CD37B6 for ; Sat, 16 Sep 2023 08:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lHfvLgdngO5a/xPeIhnqWC78WVW1J7sdyb+1w8vHuK4=; b=rVEtTXWWUcjR/DVBOLahmgJSc4 GwFhb/kPMYQhvWBnEeVbG3qrKmsZOZQAt/Uv/zlK4anCTtzKRX5aLqNjX2iDcmI4Xx0UVw2Y2fGTN IyrXWiigUImWIVyuqc1Fh1o52Zzk2n+gq6CpZCL+XEUlckC/AdfxnIlG31b4jav0HnUUeAS/Dk8Vv GrThUY8BrqebdX28ifrY5QJwXLRvrSBL236Qk2FA1Nezwm4TGQ/ocoyouP0fyuqwHUr1gEawC9yXj NvSK6p9MMa20fhte6OqejnEoNFjLc26vU79stfygPyF+uRg2AQ3SM7VaBL6K0qeNWHTkODRD3NiKg xiDMiF1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQ2-00CA56-2X; Sat, 16 Sep 2023 08:12:46 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQPy-00CA1D-1Y; Sat, 16 Sep 2023 08:12:43 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 1E27DB80DDB; Sat, 16 Sep 2023 08:12:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B44C433C8; Sat, 16 Sep 2023 08:12:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851959; bh=gDuGzivyyQ8xcbFnZYFp+TOLVAp3wAS56uHvlgLzSs8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BOI8U9K2Jl/RBpbL0O5fLetMAE8GEGGrk+yB2Cq9NziIhXCzwtosHXALsyebat8Nj AjspZN72qPnAeSHwcyav0UVtA66Y6d1ipkwR8kjhYnmTs9h3xKM4arM8MQQXPukHhr ZwNtnjLe3YjIgjfmfe4EZ1luzsB8A6jURhgjMBCkG3wkfMxHcWg4GdJM33ODCMdi7h 6vcQbtoOnaGpHbswQfLCNaUfcGyp13ynhK4TprN6uYUuj2V7sYp35kZoNGWKOEUHZl S6an22a3PDfpXxA2elkd5T6oKGsKQrPpCXyJGOub6PIz+F05D0LrNkdukrFn/TUuPx gWtQY+OA19qPQ== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 18/23] net: stmmac: dwmac-sun8i: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:24 +0800 Message-Id: <20230916075829.1560-19-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011242_815062_8514C127 X-CRM114-Status: GOOD ( 12.33 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 Reviewed-by: Jernej Skrabec --- 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 01e77368eef1..63a7e5e53d7b 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); } From patchwork Sat Sep 16 07:58:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7768FCD37B5 for ; Sat, 16 Sep 2023 08:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6/xUoyIFASPIfXzO7DjHxdTqcD1CDAyUsRNRIBCEazE=; b=OjLvi+fUmOyGOJwXemSue0wVnW 4p9cMeOHHGSGEkBoptMs8SGII3sa8orceImw3EkCYipoNyrW5OmYAap5N1fcs4I8ZdDkn799zlTSg z+sR6UyhM7WD6dorxhAp8L0ChPcB8IEVvwTCW2uXnwfXw3KIVx5wFwW39vcje2rXct5sGjLG0x6Cm VIOzZcWT/kDlwlzKdqSIZng6rVY+T8KScvPfOH4An9Dmv0zPcUNCJh9TzPYxg14bos0ubbZZyQCQg fuHi2YxxcOHOpP0cUfBGTHVQl2xwcyyemaU0AU1Ywtq0jz0XSlyED/kUagIcvhEqAexRdSRfKOOSO i7HS6yLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQA-00CAAj-1H; Sat, 16 Sep 2023 08:12:54 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQ6-00CA6v-17; Sat, 16 Sep 2023 08:12:52 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id AE424CE2BD0; Sat, 16 Sep 2023 08:12:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E48DC433CA; Sat, 16 Sep 2023 08:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851967; bh=YIjtmUbVrg/RXcc1/xGF0odjZwPY+o3yQzwT12xvMT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ih3jhFek7Im/uNs9x+ian0b7ZipqTfZA29fQeyQ0M/r4MkwvWGCVgx/iFYivQs/xz AIGGMW/YQ0RUlDqjdl7TSesFoSkgf0nud823dgrt0fyF16nrxFEa/+aUiHkwUzxU8E DBFm8s9CiCMbiNrJtUAbx61Xo0Rp1bA8N/cWlsKGbz6drGc/M9tectoq9B3yeZ7osH dB8bQvYXgi6Jj0osY7yn8ZEw4rZG6OWI8TlZnSpkQ2TisGhd2YHqz1SdaK+K7RbmDG w1nfDAmwC+TDgh8NUHA32q6NcujKPO2jW6z2W/QrqkjEZWXD/MldrB0ASbVoZnHnFI U5MxpToJREWdg== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 19/23] net: stmmac: dwmac-sunxi: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:25 +0800 Message-Id: <20230916075829.1560-20-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011250_745265_AB690AD8 X-CRM114-Status: GOOD ( 15.34 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 Reviewed-by: Jernej Skrabec --- .../net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c index beceeae579bf..b857235f5b1f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c @@ -108,36 +108,31 @@ static int sun7i_gmac_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); gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL); - if (!gmac) { - ret = -ENOMEM; - goto err_remove_config_dt; - } + if (!gmac) + return -ENOMEM; ret = of_get_phy_mode(dev->of_node, &gmac->interface); if (ret && ret != -ENODEV) { dev_err(dev, "Can't get phy-mode\n"); - goto err_remove_config_dt; + return ret; } gmac->tx_clk = devm_clk_get(dev, "allwinner_gmac_tx"); if (IS_ERR(gmac->tx_clk)) { dev_err(dev, "could not get tx clock\n"); - ret = PTR_ERR(gmac->tx_clk); - goto err_remove_config_dt; + return PTR_ERR(gmac->tx_clk); } /* Optional regulator for PHY */ gmac->regulator = devm_regulator_get_optional(dev, "phy"); if (IS_ERR(gmac->regulator)) { - if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER) { - ret = -EPROBE_DEFER; - goto err_remove_config_dt; - } + if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER) + return -EPROBE_DEFER; dev_info(dev, "no regulator found\n"); gmac->regulator = NULL; } @@ -155,7 +150,7 @@ static int sun7i_gmac_probe(struct platform_device *pdev) ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv); if (ret) - goto err_remove_config_dt; + return ret; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) @@ -165,8 +160,6 @@ static int sun7i_gmac_probe(struct platform_device *pdev) err_gmac_exit: sun7i_gmac_exit(pdev, plat_dat->bsp_priv); -err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } @@ -179,7 +172,7 @@ MODULE_DEVICE_TABLE(of, sun7i_dwmac_match); static struct platform_driver sun7i_dwmac_driver = { .probe = sun7i_gmac_probe, - .remove_new = stmmac_pltfr_remove, + .remove_new = stmmac_pltfr_remove_no_dt, .driver = { .name = "sun7i-dwmac", .pm = &stmmac_pltfr_pm_ops, From patchwork Sat Sep 16 07:58:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCDABCD37B6 for ; Sat, 16 Sep 2023 08:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ir7K2TgyDMN2JNrFe1z8evNf2YIGoOpWJRSFUqqcp6s=; b=wxYHN9Uh1SLfqoykKckgmjAHqk KYUxolvRk/caRoe5eQR7fclOIN+jRxpTyJ6JSmYoubFBa7dMDpsLzoea7DtodJX5++XDUaqIHca2q kiGX/aRv1gL5VgmoKspo7KzcJY0S3jlEdOE1ZOZJVjOiMURjsN+PZ2hvc0CWN5Pf8/OFgVflCUTWr KJJrHN89qJOeokSSUf/Yo2q83frGdP2i6HOvKjSB7+86EcWimn+MjSRrIctkUmXp3xtGleKFAi1+E E9ZpvMvCd+xqH6vB9A7cnev4bR1DFk//NsBlywV6s891ua9aGtnHlIzUPMIc49G/OWLWmDpMfXfuS jvLc3xMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQG-00CAG0-26; Sat, 16 Sep 2023 08:13:00 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQC-00CACF-1v; Sat, 16 Sep 2023 08:12:58 +0000 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 A9F5260AEB; Sat, 16 Sep 2023 08:12:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 733EAC433CB; Sat, 16 Sep 2023 08:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851973; bh=KSe7NuuTmvNFUfkVlgyIp0m+TWXLJzpYZqE/n8ra5Ws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rnDqtul2beGLFRSZ/OiQBcgCaJeOxva6GCnQCtR2em+MPpVlkpcK/TGM7Hvmdr0S6 JnJ4RxRcSwV/5iPCEPMGQSTXMLMNagH2FY5rkJ+j0/ApgIio2H5vVhaiJ2MgNz798r u12j/JAJM498uaSEzRXKfcL995+xhFZy7998UZPYjTPCdJI38pIJuYY1VYhlm7+Ufb MLZhYLL2igKv3/oCrQMmW6DJt/vcuUBJqQ+m4lsMocN3quCJCSjPgE3j+1SwahqyBq Lu4NyCu4pVmEl+TsMNh5e+kT+7xx4jMP2MhAYKAu6nEW+6xFvM/V3ByDPG1zS/dMf3 cM97RocNCB/0w== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 20/23] net: stmmac: dwmac-tegra: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:26 +0800 Message-Id: <20230916075829.1560-21-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011256_728526_0C2D4ABA X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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-tegra.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c index e0f3cbd36852..7e512c0762ea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c @@ -284,7 +284,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) if (err < 0) goto disable_clks; - plat = stmmac_probe_config_dt(pdev, res.mac); + plat = devm_stmmac_probe_config_dt(pdev, res.mac); if (IS_ERR(plat)) { err = PTR_ERR(plat); goto disable_clks; @@ -303,7 +303,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) GFP_KERNEL); if (!plat->mdio_bus_data) { err = -ENOMEM; - goto remove; + goto disable_clks; } } @@ -321,7 +321,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev) 500, 500 * 2000); if (err < 0) { dev_err(mgbe->dev, "timeout waiting for TX lane to become enabled\n"); - goto remove; + goto disable_clks; } plat->serdes_powerup = mgbe_uphy_lane_bringup_serdes_up; @@ -342,12 +342,10 @@ static int tegra_mgbe_probe(struct platform_device *pdev) err = stmmac_dvr_probe(&pdev->dev, plat, &res); if (err < 0) - goto remove; + goto disable_clks; return 0; -remove: - stmmac_remove_config_dt(pdev, plat); disable_clks: clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks); @@ -360,7 +358,7 @@ static void tegra_mgbe_remove(struct platform_device *pdev) clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks); - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); } static const struct of_device_id tegra_mgbe_match[] = { From patchwork Sat Sep 16 07:58:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E143CD37B5 for ; Sat, 16 Sep 2023 08:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AoJHwVzKjAVPl2SiDG/Wm5eJZC+r+q1+0e1eR8JW8Tw=; b=0OBmRl5rexU4sFOCaltyImYkDo PxL3LfYt6otMlhwHNLd1R/q5xVGcQhsUA7i9Oc3QZxGIU3wcg2NmVJoRkr9TXTcABvhCNjJ8bN4+5 DDalTUmkZywVCPkpkHqLjNDYghU2VlYmX4djSbQ6lTc9SvYz6GP7PTiZRyeWmyHSzHi3M6dU1XfMN YKKkX6X5xi0aLVRtusYC0Tpz/4Hp6MD91ZZEWP2Gz2abCp5dfJwuyDAZKUIPSQiOBRgErnaaauI/J 36Eux6s6LRUV/G6Yf8EUjFP6JrWfxgQHLkafnLOTwMUgViOOGUaVU5VAZoREdsRHk47PE7mhWTE3B in0451zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQO-00CANE-1h; Sat, 16 Sep 2023 08:13:08 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQJ-00CAHu-2l; Sat, 16 Sep 2023 08:13:05 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 31D7FCE1D31; Sat, 16 Sep 2023 08:13:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CF32C433CC; Sat, 16 Sep 2023 08:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851980; bh=Vn4X1L24g5YyN7wIK/5umFerdTWl1xsiC5BXRJlo0ZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O9HcqfTQBB5HNBS5CaxsZ9ATh339mrairARWQy/+9ekCD43XOyoPlsXz+SMZjx7k9 ocb+OAj3EzdtjZn/KPBJhVsDwXga1309k6T+xbV2vZdZRhiu3xPJs7ZVNXOs3L0ICA n/k1kTPyhSXQc1gAJP6+YD0ZoGYie/fuAfxkL4tKF4m169q5/rYDUwtgr/7B7a5bLH pEdVVqmKbWEW4H+pvTRL9UlOIpcy+S9MoQWNZCA+j3au9cSPs7KVQsE47dNIvRJKCF huSA+CNTG+zuFTMKrei+TGDDMd1mgTOZRcF7dmfkbtotuHtMPQe9J9xX0udXRt/V9H snKFQjeUi+UvQ== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 21/23] net: stmmac: dwmac-visconti: use devm_stmmac_probe_config_dt() Date: Sat, 16 Sep 2023 15:58:27 +0800 Message-Id: <20230916075829.1560-22-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011304_256850_61AD9F20 X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 --- .../ethernet/stmicro/stmmac/dwmac-visconti.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c index 22d113fb8e09..45f5d66a11c2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c @@ -220,15 +220,13 @@ static int visconti_eth_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 remove_config; - } + if (!dwmac) + return -ENOMEM; spin_lock_init(&dwmac->lock); dwmac->reg = stmmac_res.addr; @@ -238,7 +236,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev) ret = visconti_eth_clock_probe(pdev, plat_dat); if (ret) - goto remove_config; + return ret; visconti_eth_init_hw(pdev, plat_dat); @@ -252,22 +250,15 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev) remove: visconti_eth_clock_remove(pdev); -remove_config: - stmmac_remove_config_dt(pdev, plat_dat); return ret; } static void visconti_eth_dwmac_remove(struct platform_device *pdev) { - struct net_device *ndev = platform_get_drvdata(pdev); - struct stmmac_priv *priv = netdev_priv(ndev); - - stmmac_pltfr_remove(pdev); + stmmac_pltfr_remove_no_dt(pdev); visconti_eth_clock_remove(pdev); - - stmmac_remove_config_dt(pdev, priv->plat); } static const struct of_device_id visconti_eth_dwmac_match[] = { From patchwork Sat Sep 16 07:58:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38FB3CD37B5 for ; Sat, 16 Sep 2023 08:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VSoMZovhcIBpUavimSPIT2pluYh6FMrtb6pPi0LSqdU=; b=Ca50zTNEG+HG+rSnZHPruNg9HX UwxIyIXVZsRVmV4RFJVeu2beYPUpWDAFVZ8MUOzLEc3yud4zKA++t8tXjgholqZPLInklRTEMxpF2 OxbatCIl15hBdOSOI2GD00NU5M/TUhMb8yxpA5iJHPZbEx0Qzwz2YYGOB/9j16uomgv40RO4uyIqi wrI0Sr2TFhRhAHrAXrMp0ZVbYMeQmp8Jc7q7drCSvPMc8iDpDcR/gMvwUYHFQQDV05Op+4uF/Rapc jl3GCW0gQnURfAQDBx2Wm3gvGBp7ka7lyC85jS/aia5c5aT9NL9JnwnI/pP+fXGuxtb1N+VaKMG0l hrpdd9LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQW-00CAUD-31; Sat, 16 Sep 2023 08:13:16 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQQ-00CANx-28; Sat, 16 Sep 2023 08:13:14 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id B77ECCE2D5C; Sat, 16 Sep 2023 08:13:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E25B1C433D9; Sat, 16 Sep 2023 08:13:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851987; bh=Ook4MmbZyTHTwBCPoZcoElhvKPXaGKHEfuZZRckhrmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nvRKVGJKVHMGLMpp5YqLLYgdXsun+QlFWk4gFlg85cQYIwJ0diFJXzoJtQvgRYI+z 3pRwqAoLxhGAEnlm/HY8SDM55pRzT8xmX6w8U6xpUmXUqbFUiXxjjqiicaNhXWb1RS 5UWBpJunRapoCq9ybIJHKOg3rubzsaW5eVQNSI5sjTQC8ziQ/6+XoSTUSX7hHMUdWV 3T0ogMoSc5oPSVIDwofX2oYTnU5qXVRsP9cC6Wt0JygjJCybt5EZcnUMHaJNHOvQxN Gb90KRTtGWCtSAdKHRTe8BlG1SBH+9WaRRXjNV849EigxmDn1gO0gcwHRRIHvg5MRM GALllzSuuDR9w== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 22/23] net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove Date: Sat, 16 Sep 2023 15:58:28 +0800 Message-Id: <20230916075829.1560-23-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011311_085545_EA2E8D33 X-CRM114-Status: GOOD ( 18.33 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Now, all users of the old stmmac_pltfr_remove() are converted to the devres helper, it's time to rename stmmac_pltfr_remove_no_dt() back to stmmac_pltfr_remove() and remove the old stmmac_pltfr_remove(). Signed-off-by: Jisheng Zhang --- .../ethernet/stmicro/stmmac/dwmac-anarion.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-imx.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-ingenic.c | 2 +- .../stmicro/stmmac/dwmac-intel-plat.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-ipq806x.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-lpc18xx.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-meson.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-meson8b.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-socfpga.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-starfive.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-tegra.c | 2 +- .../ethernet/stmicro/stmmac/dwmac-visconti.c | 3 +-- .../ethernet/stmicro/stmmac/stmmac_platform.c | 23 +++---------------- .../ethernet/stmicro/stmmac/stmmac_platform.h | 1 - 17 files changed, 18 insertions(+), 37 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c index 0df3a2ad0986..643ee6d8d4dd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c @@ -135,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_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "anarion-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index e5989424894b..8f730ada71f9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -418,7 +418,7 @@ MODULE_DEVICE_TABLE(of, imx_dwmac_match); static struct platform_driver imx_dwmac_driver = { .probe = imx_dwmac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "imx-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c index 3f87053ffc07..19c93b998fb3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c @@ -370,7 +370,7 @@ MODULE_DEVICE_TABLE(of, ingenic_mac_of_matches); static struct platform_driver ingenic_mac_driver = { .probe = ingenic_mac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "ingenic-mac", .pm = pm_ptr(&ingenic_mac_pm_ops), diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c index d1aec2ca2b42..70edc5232379 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c @@ -164,7 +164,7 @@ static void intel_eth_plat_remove(struct platform_device *pdev) { struct intel_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev); - stmmac_pltfr_remove_no_dt(pdev); + stmmac_pltfr_remove(pdev); clk_disable_unprepare(dwmac->tx_clk); } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c index a9916fd07616..281687d7083b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c @@ -487,7 +487,7 @@ MODULE_DEVICE_TABLE(of, ipq806x_gmac_dwmac_match); static struct platform_driver ipq806x_gmac_dwmac_driver = { .probe = ipq806x_gmac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "ipq806x-gmac-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c index dad23b47f383..4c810d8f5bea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c @@ -72,7 +72,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match); static struct platform_driver lpc18xx_dwmac_driver = { .probe = lpc18xx_dwmac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "lpc18xx-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c index 11976a854240..2a9132d6d743 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c @@ -683,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_no_dt(pdev); + stmmac_pltfr_remove(pdev); mediatek_dwmac_clks_config(priv_plat, false); } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c index 3373d3ec2368..a16bfa9089ea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c @@ -78,7 +78,7 @@ MODULE_DEVICE_TABLE(of, meson6_dwmac_match); static struct platform_driver meson6_dwmac_driver = { .probe = meson6_dwmac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "meson6-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c index 37f249980929..b23944aa344e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c @@ -520,7 +520,7 @@ MODULE_DEVICE_TABLE(of, meson8b_dwmac_match); static struct platform_driver meson8b_dwmac_driver = { .probe = meson8b_dwmac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "meson8b-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 03e7701d0186..ba2ce776bd4d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -500,7 +500,7 @@ static void socfpga_dwmac_remove(struct platform_device *pdev) struct stmmac_priv *priv = netdev_priv(ndev); struct phylink_pcs *pcs = priv->hw->lynx_pcs; - stmmac_pltfr_remove_no_dt(pdev); + stmmac_pltfr_remove(pdev); lynx_pcs_destroy(pcs); } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c index e87b4d335c72..5d630affb4d1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c @@ -152,7 +152,7 @@ MODULE_DEVICE_TABLE(of, starfive_dwmac_match); static struct platform_driver starfive_dwmac_driver = { .probe = starfive_dwmac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "starfive-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 63a7e5e53d7b..1c702d0b2d29 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1312,7 +1312,7 @@ static void sun8i_dwmac_remove(struct platform_device *pdev) clk_put(gmac->ephy_clk); } - stmmac_pltfr_remove_no_dt(pdev); + stmmac_pltfr_remove(pdev); sun8i_dwmac_unset_syscon(gmac); } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c index b857235f5b1f..2653a9f0958c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c @@ -172,7 +172,7 @@ MODULE_DEVICE_TABLE(of, sun7i_dwmac_match); static struct platform_driver sun7i_dwmac_driver = { .probe = sun7i_gmac_probe, - .remove_new = stmmac_pltfr_remove_no_dt, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "sun7i-dwmac", .pm = &stmmac_pltfr_pm_ops, diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c index 7e512c0762ea..362f85136c3e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c @@ -358,7 +358,7 @@ static void tegra_mgbe_remove(struct platform_device *pdev) clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks); - stmmac_pltfr_remove_no_dt(pdev); + stmmac_pltfr_remove(pdev); } static const struct of_device_id tegra_mgbe_match[] = { diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c index 45f5d66a11c2..a5a5cfa989c6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c @@ -256,8 +256,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev) static void visconti_eth_dwmac_remove(struct platform_device *pdev) { - stmmac_pltfr_remove_no_dt(pdev); - + stmmac_pltfr_remove(pdev); visconti_eth_clock_remove(pdev); } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 0f28795e581c..716434b58321 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -807,7 +807,7 @@ static void devm_stmmac_pltfr_remove(void *data) { struct platform_device *pdev = data; - stmmac_pltfr_remove_no_dt(pdev); + stmmac_pltfr_remove(pdev); } /** @@ -834,12 +834,12 @@ int devm_stmmac_pltfr_probe(struct platform_device *pdev, EXPORT_SYMBOL_GPL(devm_stmmac_pltfr_probe); /** - * stmmac_pltfr_remove_no_dt + * stmmac_pltfr_remove * @pdev: pointer to the platform device * Description: This undoes the effects of stmmac_pltfr_probe() by removing the * driver and calling the platform's exit() callback. */ -void stmmac_pltfr_remove_no_dt(struct platform_device *pdev) +void stmmac_pltfr_remove(struct platform_device *pdev) { struct net_device *ndev = platform_get_drvdata(pdev); struct stmmac_priv *priv = netdev_priv(ndev); @@ -848,23 +848,6 @@ void stmmac_pltfr_remove_no_dt(struct platform_device *pdev) stmmac_dvr_remove(&pdev->dev); stmmac_pltfr_exit(pdev, plat); } -EXPORT_SYMBOL_GPL(stmmac_pltfr_remove_no_dt); - -/** - * stmmac_pltfr_remove - * @pdev: platform device pointer - * Description: this function calls the main to free the net resources - * and calls the platforms hook and release the resources (e.g. mem). - */ -void stmmac_pltfr_remove(struct platform_device *pdev) -{ - struct net_device *ndev = platform_get_drvdata(pdev); - struct stmmac_priv *priv = netdev_priv(ndev); - struct plat_stmmacenet_data *plat = priv->plat; - - stmmac_pltfr_remove_no_dt(pdev); - stmmac_remove_config_dt(pdev, plat); -} EXPORT_SYMBOL_GPL(stmmac_pltfr_remove); /** diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h index c5565b2a70ac..bb07a99e1248 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h @@ -32,7 +32,6 @@ int stmmac_pltfr_probe(struct platform_device *pdev, int devm_stmmac_pltfr_probe(struct platform_device *pdev, struct plat_stmmacenet_data *plat, struct stmmac_resources *res); -void stmmac_pltfr_remove_no_dt(struct platform_device *pdev); void stmmac_pltfr_remove(struct platform_device *pdev); extern const struct dev_pm_ops stmmac_pltfr_pm_ops; From patchwork Sat Sep 16 07:58:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13388189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30BA9CD37B6 for ; Sat, 16 Sep 2023 08:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=raURXtsDsmO8FQZ3EqpFfDzrrvESmVA0RTWV0kDTmwc=; b=0UpNgUbi7D2yNLMPIkjQVs2UwH Mw/1Z8VDrMvxY+XejTu6kt+3SXmmjU5ZtmbYnDm4kW8XrkATJuBLJoLUnUQCt3t3ly7JcKH8z4P7P h+oTYJdVczdhfnWIj9wJAXV+y1oac9CPKtRJH38UOLMtRxWtYPqMs0Dw3rB4TagKcMtes6cI0z7D3 Vs6JUZnDrvlhY2s53bA1EEv1Cj/B0zqgLhVHsDXhGG+3EL7TWJ0tA/yZfY/E7q9S4BQnQFFwqkSYn I7NTeXQV1aJxVjA3KDGxR4oGiXCK7iRqO4XJTb2ziJchvx4QYMme3ZexKjtZUMu6KFa0pfUH6MTZq UnKSsA0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQd-00CAZz-0L; Sat, 16 Sep 2023 08:13:23 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qhQQX-00CATE-11; Sat, 16 Sep 2023 08:13:19 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id 40FE5CE2C88; Sat, 16 Sep 2023 08:13:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 754C6C43391; Sat, 16 Sep 2023 08:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694851993; bh=SbggMlwJmGCB60uPWKaRi5TsR0G979nd8MU9xOIf0lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uXSdb0bhIxN0kQMA76OEwrbI8wVWljqxCRLq7WOcHzQBXC/VR9SL7OiaBND9bS8Ql UCugoEdaqhd0REzK1bwto/i5rtvyfhl8jQI1CDtt6dEbsk0yNu4edCMJz9Gdvkgq9+ +kF2rbFNV1v7YcKqKtLORvAiNQSdiT9wvY7PfB85hCgpefuSM5cKL6xfGvcpMvZtkn uD3l0NZRsXjdlgmwkZgH/Sz9IloouFroW6TE8xiAfi8o0GynY8rrnPLj3N5vKLui1n ZZXzIHJWxCq1WDxT7bwirT80KL2/joCYGfPGGsbNespTMauW6p1LPvxAbgBjGCtTRz Njkq0gUGcXwBg== 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 , Nobuhiro Iwamatsu , Russell King , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v2 23/23] net: stmmac: make stmmac_{probe|remove}_config_dt static Date: Sat, 16 Sep 2023 15:58:29 +0800 Message-Id: <20230916075829.1560-24-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230916075829.1560-1-jszhang@kernel.org> References: <20230916075829.1560-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230916_011317_729761_2973D6B0 X-CRM114-Status: GOOD ( 14.15 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Now there's no external users of these two functions, make them static so that there aren't any new usages of stmmac_probe_config_dt(). To avoid forward declaration, move stmmac_remove_config_dt() location. Signed-off-by: Jisheng Zhang Suggested-by: Russell King --- .../ethernet/stmicro/stmmac/stmmac_platform.c | 47 +++++++------------ .../ethernet/stmicro/stmmac/stmmac_platform.h | 4 -- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 716434b58321..2063de1683b2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -384,6 +384,22 @@ static int stmmac_of_get_mac_mode(struct device_node *np) return -ENODEV; } +/** + * stmmac_remove_config_dt - undo the effects of stmmac_probe_config_dt() + * @pdev: platform_device structure + * @plat: driver data platform structure + * + * Release resources claimed by stmmac_probe_config_dt(). + */ +static void stmmac_remove_config_dt(struct platform_device *pdev, + struct plat_stmmacenet_data *plat) +{ + clk_disable_unprepare(plat->stmmac_clk); + clk_disable_unprepare(plat->pclk); + of_node_put(plat->phy_node); + of_node_put(plat->mdio_node); +} + /** * stmmac_probe_config_dt - parse device-tree driver parameters * @pdev: platform_device structure @@ -392,7 +408,7 @@ static int stmmac_of_get_mac_mode(struct device_node *np) * this function is to read the driver parameters from device-tree and * set some private fields that will be used by the main at runtime. */ -struct plat_stmmacenet_data * +static struct plat_stmmacenet_data * stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) { struct device_node *np = pdev->dev.of_node; @@ -662,43 +678,14 @@ devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) return plat; } - -/** - * stmmac_remove_config_dt - undo the effects of stmmac_probe_config_dt() - * @pdev: platform_device structure - * @plat: driver data platform structure - * - * Release resources claimed by stmmac_probe_config_dt(). - */ -void stmmac_remove_config_dt(struct platform_device *pdev, - struct plat_stmmacenet_data *plat) -{ - clk_disable_unprepare(plat->stmmac_clk); - clk_disable_unprepare(plat->pclk); - of_node_put(plat->phy_node); - of_node_put(plat->mdio_node); -} #else -struct plat_stmmacenet_data * -stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) -{ - return ERR_PTR(-EINVAL); -} - struct plat_stmmacenet_data * devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) { return ERR_PTR(-EINVAL); } - -void stmmac_remove_config_dt(struct platform_device *pdev, - struct plat_stmmacenet_data *plat) -{ -} #endif /* CONFIG_OF */ -EXPORT_SYMBOL_GPL(stmmac_probe_config_dt); EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt); -EXPORT_SYMBOL_GPL(stmmac_remove_config_dt); int stmmac_get_platform_resources(struct platform_device *pdev, struct stmmac_resources *stmmac_res) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h index bb07a99e1248..bb6fc7e59aed 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h @@ -11,12 +11,8 @@ #include "stmmac.h" -struct plat_stmmacenet_data * -stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac); struct plat_stmmacenet_data * devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac); -void stmmac_remove_config_dt(struct platform_device *pdev, - struct plat_stmmacenet_data *plat); int stmmac_get_platform_resources(struct platform_device *pdev, struct stmmac_resources *stmmac_res);