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 68C93C3DA7F for ; Wed, 7 Aug 2024 09:50:51 +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:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Date:CC:To:From :Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p5E9zKddV2feWg3wZzHXjmOXnbNEA6sewjjyQImkQDw=; b=FESSw//O/E3iFupyra5M/9Lp+8 R24EvHgXzfI14B145MbhdJPWHwTzYg5H/YbP+M/lqFW3ClsdCfT7lBrCLc5KeQvPl3Y99NVChGlQc 1zr9Z/Uj5Z+H8/VzufxsTWZg3UUSq8ZyVLdyFO1kxi8yV4X5IzSin0pAzr72uaKZENAgwfpkFwtAx 2EC+BNAWs/MDPdATgAHknNkrAaIXHjUdepsvIqK8Dmw5GKOxoN3v0kr8p4d+AlWN3DzpNhpxgULoA vIqUTcBttrKKAuDZVFW/lHL3ePM8mEsJLNQuAv5lg3YUSvykKfuuWlidOhdoDDx3kOB3gTmGwx84/ ztVFD4UQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbdJa-00000004c7m-0qf4; Wed, 07 Aug 2024 09:50:42 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbdIb-00000004bth-1NhK for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 09:49:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1723024181; x=1754560181; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=p5E9zKddV2feWg3wZzHXjmOXnbNEA6sewjjyQImkQDw=; b=Dnzb5k9mWBCoWnn104zJTjvQH35ruZFwHnfDfgnm9vBJNgdOKGF1JsXK Tbv/+9mH4y4rr40mP1ReqAaLyRpjFxLLTLl3wWa4U801cm18OwSFun8ZW KbDQ4x2BfsO6dMVIiIcsNCdSREEHG7KbFhKcW3wKpOLyvMSGzaqifP9wx HGeKayx56nEsHMXB3HSHCMBPs8ECtzL0R54A+4FttFIShNk9ukm/OZsOu kjRu0/xv12YFdD4PtNPp1Xr3O7nLX403tlXb2jrmRP/Tz21dGAyFvpwpL 3oX8eNHJvBZ5e2zIDs+VseDa7OdOevMNwrKXtI6rsTjU1gw/ndY+v7b+I w==; X-CSE-ConnectionGUID: 84YL2YxrTjaVTxV9Ds3KIA== X-CSE-MsgGUID: dX1L9EdXR1qffcjUQ4NgVQ== X-IronPort-AV: E=Sophos;i="6.09,269,1716274800"; d="scan'208";a="30861844" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 07 Aug 2024 02:49:39 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 7 Aug 2024 02:49:01 -0700 Received: from DEN-DL-M31857.microsemi.net (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 7 Aug 2024 02:48:56 -0700 Message-ID: <33d1dabf26457f0a43c78a35ac1d8bcf35f15bc5.camel@microchip.com> Subject: Re: [PATCH v4 6/8] reset: mchp: sparx5: Release syscon when not use anymore From: Steen Hegelund To: Herve Codina , Geert Uytterhoeven , Andy Shevchenko , "Simon Horman" , Lee Jones , Arnd Bergmann , Derek Kiernan , Dragan Cvetic , Greg Kroah-Hartman , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Daniel Machon , , Rob Herring , Saravana Kannan CC: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , "Andrew Lunn" , , , , , , "Allan Nielsen" , Luca Ceresoli , Thomas Petazzoni , =?ISO-8859-1?Q?Cl=E9ment_L=E9ger?= Date: Wed, 7 Aug 2024 11:48:56 +0200 In-Reply-To: <20240805101725.93947-7-herve.codina@bootlin.com> References: <20240805101725.93947-1-herve.codina@bootlin.com> <20240805101725.93947-7-herve.codina@bootlin.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_024941_466951_4A6C8F9B X-CRM114-Status: GOOD ( 20.57 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Herve, On Mon, 2024-08-05 at 12:17 +0200, Herve Codina wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe >=20 > From: Cl=C3=A9ment L=C3=A9ger >=20 > The sparx5 reset controller does not release syscon when it is not > used > anymore. >=20 > This reset controller is used by the LAN966x PCI device driver. > It can be removed from the system at runtime and needs to release its > consumed syscon on removal. >=20 > Use the newly introduced devm_syscon_regmap_lookup_by_phandle() in > order > to get the syscon and automatically release it on removal. >=20 > Signed-off-by: Cl=C3=A9ment L=C3=A9ger > Signed-off-by: Herve Codina > --- > =C2=A0drivers/reset/reset-microchip-sparx5.c | 8 ++------ > =C2=A01 file changed, 2 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/reset/reset-microchip-sparx5.c > b/drivers/reset/reset-microchip-sparx5.c > index 69915c7b4941..c4fe65291a43 100644 > --- a/drivers/reset/reset-microchip-sparx5.c > +++ b/drivers/reset/reset-microchip-sparx5.c > @@ -65,15 +65,11 @@ static const struct reset_control_ops > sparx5_reset_ops =3D { > =C2=A0static int mchp_sparx5_map_syscon(struct platform_device *pdev, cha= r > *name, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct regmap **target) > =C2=A0{ > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct device_node *syscon_np; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct device *dev =3D &pdev->dev; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct regmap *regmap; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int err; >=20 > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 syscon_np =3D of_parse_phandle(pdev= ->dev.of_node, name, 0); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!syscon_np) > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 return -ENODEV; > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 regmap =3D syscon_node_to_regmap(sy= scon_np); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 of_node_put(syscon_np); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 regmap =3D devm_syscon_regmap_looku= p_by_phandle(dev, dev- > >of_node, name); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (IS_ERR(regmap)) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 err =3D PTR_ERR(regmap); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 dev_err(&pdev->dev, "No '%s' map: %d\n", name, err); > -- > 2.45.0 >=20 Looks good to me. Reviewed-by: Steen Hegelund BR Steen