lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <33d1dabf26457f0a43c78a35ac1d8bcf35f15bc5.camel@microchip.com>
Date: Wed, 7 Aug 2024 11:48:56 +0200
From: Steen Hegelund <steen.hegelund@...rochip.com>
To: Herve Codina <herve.codina@...tlin.com>, Geert Uytterhoeven
	<geert@...ux-m68k.org>, Andy Shevchenko <andy.shevchenko@...il.com>, "Simon
 Horman" <horms@...nel.org>, Lee Jones <lee@...nel.org>, Arnd Bergmann
	<arnd@...db.de>, Derek Kiernan <derek.kiernan@....com>, Dragan Cvetic
	<dragan.cvetic@....com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>, Philipp Zabel <p.zabel@...gutronix.de>,
	Lars Povlsen <lars.povlsen@...rochip.com>, Daniel Machon
	<daniel.machon@...rochip.com>, <UNGLinuxDriver@...rochip.com>, Rob Herring
	<robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>
CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
	<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, Horatiu Vultur <horatiu.vultur@...rochip.com>, "Andrew
 Lunn" <andrew@...n.ch>, <linux-kernel@...r.kernel.org>,
	<netdev@...r.kernel.org>, <linux-pci@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <devicetree@...r.kernel.org>, "Allan
 Nielsen" <allan.nielsen@...rochip.com>, Luca Ceresoli
	<luca.ceresoli@...tlin.com>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	Clément Léger <clement.leger@...tlin.com>
Subject: Re: [PATCH v4 6/8] reset: mchp: sparx5: Release syscon when not use
 anymore

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
> 
> From: Clément Léger <clement.leger@...tlin.com>
> 
> The sparx5 reset controller does not release syscon when it is not
> used
> anymore.
> 
> 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.
> 
> Use the newly introduced devm_syscon_regmap_lookup_by_phandle() in
> order
> to get the syscon and automatically release it on removal.
> 
> Signed-off-by: Clément Léger <clement.leger@...tlin.com>
> Signed-off-by: Herve Codina <herve.codina@...tlin.com>
> ---
>  drivers/reset/reset-microchip-sparx5.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> 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 = {
>  static int mchp_sparx5_map_syscon(struct platform_device *pdev, char
> *name,
>                                   struct regmap **target)
>  {
> -       struct device_node *syscon_np;
> +       struct device *dev = &pdev->dev;
>         struct regmap *regmap;
>         int err;
> 
> -       syscon_np = of_parse_phandle(pdev->dev.of_node, name, 0);
> -       if (!syscon_np)
> -               return -ENODEV;
> -       regmap = syscon_node_to_regmap(syscon_np);
> -       of_node_put(syscon_np);
> +       regmap = devm_syscon_regmap_lookup_by_phandle(dev, dev-
> >of_node, name);
>         if (IS_ERR(regmap)) {
>                 err = PTR_ERR(regmap);
>                 dev_err(&pdev->dev, "No '%s' map: %d\n", name, err);
> --
> 2.45.0
> 

Looks good to me.

Reviewed-by: Steen Hegelund <Steen.Hegelund@...rochip.com>

BR
Steen


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ