From mboxrd@z Thu Jan 1 00:00:00 1970 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 5C0CAC88CB2 for ; Mon, 12 Jun 2023 18:23: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Gn8Q20VEWvW0ETZSfpCmHxE8xv9a86A/bjOPhoUVcMA=; b=jDuZZJePtvlxEG Z0gyhce1A24pofQZB3PVTdpPvk/yO++qiV7RAnwlBFM2urxEssD319lJFpFQFXeOaAxe2y/UCqqjl ojIWMZTJjCAMUWrggU2P1+WqeFcwaosKkAYieMiifU9WR2V6VkTisEVjn5hSi8eMBNXT3NJVqjUdk 2DaGgAUKMyZer75QFU0OAS1ccBznX3XCMaTWPGyf4MGjDkfcUEmbgq/bsnObwKGa1FrtdAS5V9wuJ e3Fw03DLGmeTN0QLoXQBXsrYcKHjscBmyGaUqhAaS1h+PCQ/2eb/MtdG/dxRTlw12K5dlLRf4DQ81 N/W5zkPerfJWziXs65fQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q8mC4-004vK7-0A; Mon, 12 Jun 2023 18:23:08 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q8mC1-004vIO-0m for linux-arm-kernel@lists.infradead.org; Mon, 12 Jun 2023 18:23:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686594184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WuZqmtvd4WjoknFOrkLRYxUsHp5/t5pNlhuMb2dd9d8=; b=UwHa/K6K8PBd+IbAfsLhzMyxNYy7pLe0MoKG6IzbVOldXhSQ26IJosc0JyIlVznb2eMSYl wgcSkY6tpM4EJER3hkienM1c2ND2m4lN6fLXx6COsm7oec8ARi3Z7GBB088QPJqs68VXnN AjXY1rm6G/zZWxNSguqZZGkQ724X1NY= Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-295-FGqU0JltNAOmjkKLz1KwNQ-1; Mon, 12 Jun 2023 14:23:03 -0400 X-MC-Unique: FGqU0JltNAOmjkKLz1KwNQ-1 Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-1a68ea38be2so1187441fac.0 for ; Mon, 12 Jun 2023 11:23:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686594182; x=1689186182; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WuZqmtvd4WjoknFOrkLRYxUsHp5/t5pNlhuMb2dd9d8=; b=IIcyLanZaDREoa01zM8WwwHsRgdrxfnMIfWhklQsm07kxS5kcgxezjGPslR58uVsXr oy6LNH20IhWV5hWt0DUJVpGIHtr3YfFQ4/H5HC/61aw0MmotXbl1nBmNbIr56xwA7L5I VrUmN8wiy3TMEHY8y+5JP5hnui4OcJvbiRrWrzJL3z3JVpSVwvzizCpbhn3QJ+q/lPH6 nlX09HAHAHd3K13P9GDt0W5wwAbWUOz/d6ovY1asTb8qIRPvsKvN6sa+rJsonE70833Q rnCAznj1p17iEXRTzI1m9VoHym3p+QrRc5MxGO89tqMl/u/YUp8VBdndNBpmTjjlGIZX UJCg== X-Gm-Message-State: AC+VfDzLrrqIRQFNoL5ociDnXe/MrZwv7rAItUoEsi7GobBS7GBNTWXS 90Olt+xzk1r4y2Ab8B2cz099naQ+KcqbAuA/hePVv4umMpck89Ec+882N/YYptGBD1ClpPzjCMG EmLNKIc3ymx+qEX97s0Tl+/1CFj0eArsgxiI= X-Received: by 2002:a05:6870:3403:b0:1a6:a28b:6e4 with SMTP id g3-20020a056870340300b001a6a28b06e4mr1424840oah.37.1686594182236; Mon, 12 Jun 2023 11:23:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ojOAZsqcF6bnSAgTcknWHmKu5ibIbDyN5vE0vwVE23kVcIn47oSmy77InfhxOlx0UQ4BxKw== X-Received: by 2002:a05:6870:3403:b0:1a6:a28b:6e4 with SMTP id g3-20020a056870340300b001a6a28b06e4mr1424739oah.37.1686594179927; Mon, 12 Jun 2023 11:22:59 -0700 (PDT) Received: from halaney-x13s ([2600:1700:1ff0:d0e0::45]) by smtp.gmail.com with ESMTPSA id r34-20020a05687108a200b001a68feb9440sm1579964oaq.9.2023.06.12.11.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 11:22:59 -0700 (PDT) Date: Mon, 12 Jun 2023 13:22:56 -0500 From: Andrew Halaney To: Bartosz Golaszewski Cc: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kishon Vijay Abraham I , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Bartosz Golaszewski Subject: Re: [PATCH 05/26] net: stmmac: dwmac-qcom-ethqos: shrink clock code with devres Message-ID: <20230612182256.7cc3goqwid32fdn6@halaney-x13s> References: <20230612092355.87937-1-brgl@bgdev.pl> <20230612092355.87937-6-brgl@bgdev.pl> MIME-Version: 1.0 In-Reply-To: <20230612092355.87937-6-brgl@bgdev.pl> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230612_112305_357392_BC37497D X-CRM114-Status: GOOD ( 24.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 12, 2023 at 11:23:34AM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > We can use a devm action to completely drop the remove callback and use > stmmac_pltfr_remove() directly for remove. We can also drop one of the > goto labels. > > Signed-off-by: Bartosz Golaszewski I think using the remove callback seems more direct to a reader, but that's pretty opinionated. The change itself looks good so: Reviewed-by: Andrew Halaney > --- > .../stmicro/stmmac/dwmac-qcom-ethqos.c | 24 +++++++++---------- > 1 file changed, 11 insertions(+), 13 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > index c801838fae2a..2da0738eed24 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > @@ -586,6 +586,11 @@ static int ethqos_clks_config(void *priv, bool enabled) > return ret; > } > > +static void ethqos_clks_disable(void *data) > +{ > + ethqos_clks_config(data, false); > +} > + > static int qcom_ethqos_probe(struct platform_device *pdev) > { > struct device_node *np = pdev->dev.of_node; > @@ -636,6 +641,10 @@ static int qcom_ethqos_probe(struct platform_device *pdev) > if (ret) > goto err_mem; > > + ret = devm_add_action_or_reset(&pdev->dev, ethqos_clks_disable, ethqos); > + if (ret) > + goto err_mem; > + > ethqos->speed = SPEED_1000; > ethqos_update_rgmii_clk(ethqos, SPEED_1000); > ethqos_set_func_clk_en(ethqos); > @@ -653,27 +662,16 @@ static int qcom_ethqos_probe(struct platform_device *pdev) > > ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); > if (ret) > - goto err_clk; > + goto err_mem; > > return ret; > > -err_clk: > - ethqos_clks_config(ethqos, false); > - > err_mem: > stmmac_remove_config_dt(pdev, plat_dat); > > return ret; > } > > -static void qcom_ethqos_remove(struct platform_device *pdev) > -{ > - struct qcom_ethqos *ethqos = get_stmmac_bsp_priv(&pdev->dev); > - > - stmmac_pltfr_remove(pdev); > - ethqos_clks_config(ethqos, false); > -} > - > static const struct of_device_id qcom_ethqos_match[] = { > { .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data}, > { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data}, > @@ -684,7 +682,7 @@ MODULE_DEVICE_TABLE(of, qcom_ethqos_match); > > static struct platform_driver qcom_ethqos_driver = { > .probe = qcom_ethqos_probe, > - .remove_new = qcom_ethqos_remove, > + .remove_new = stmmac_pltfr_remove, > .driver = { > .name = "qcom-ethqos", > .pm = &stmmac_pltfr_pm_ops, > -- > 2.39.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel