Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2151004lqb; Mon, 27 May 2024 09:21:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUUC17ycev7NiI/r6zZjYZFlum0SK7h/aaHguPfUg38l4MeA2jUTprct8k0knoMiEjhDGEg9KqHz42b9lEaQ05G+jgIhyS+rZU6X2ITfQ== X-Google-Smtp-Source: AGHT+IGOC9kpJnuhrYKOJNGIyIZpYb4kiApaDGYA5hXPi+ZmKpWfIH9mEcUAwMlWwN+rACIAEi1i X-Received: by 2002:ac2:4112:0:b0:51e:1bed:13b3 with SMTP id 2adb3069b0e04-529650a4332mr5852141e87.32.1716826900862; Mon, 27 May 2024 09:21:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716826900; cv=pass; d=google.com; s=arc-20160816; b=TxOQFBKIz+C8M2BDYqopOnMqBkOUSntMQkuXi9LebB5LVFbaii/Zs56lt3JDZmEqMp YoWrbiuZqvokW0I0fXuq7mKGy84aj0lHbM6bGQluh8e/XwDBZHhBOvV+3gAMtv0Reqiq P+nppSiNz1YXVVBrb9ysnssvTiiDCcSimjJDoLzU9o9O3hSL97wUr6T+rPURigqt5Uxu gkeW+Y7QOrCw7MlXiXQ8/7GhM0pEeeW50mfVua+EqFZTbOf/d4JSdqXZ8lAnNe2l1Gv5 m+emLNcLWpkCnZ3f86jGPDGm4l2q9lpuwTFrEtFtYmwWQe7f7gynQBe2CUZ8LdzvgrXZ PTOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=L6TlKweuD4lCqBxL9SdGBmVX01IhcfhXMnuiuGHqhBE=; fh=FgwDDXx9Ad8vmEmzzXm7uCBC9EwkDp3k7U93srafrH4=; b=wkN9q5rIkB9416Ri1YByz4P35+Zbln8XdRMrZzNTDCI49qzqymm2AjTn1QwhAcYoWP 3hIlnyVmRlOb4PKVinHj+7X23TlZrPFzjAZEVlmpdScf1Qq9/7IHkiITmMPh+59aIapQ vKuXrraX89iWjle1mC/mE15bq7CR2QhTnHcYhp4KR9czLPucl02IfnEpengbNVjFXr8v jOMfXTsjy2k1AUEVO2DhdCKv4UTXuxlZEHrXjXeDuk32YiZfkRbPwhzwAosDReDjte6w FljeHZAp9rwgbeFvsaG1qkwEPFwYSl0uM8iG22FbEYGLhWSx5/jh3OEKIfBDDUVIjEEO Xj+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LtHFpVXe; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-191214-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191214-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c80533fsi408890266b.41.2024.05.27.09.21.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 09:21:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191214-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LtHFpVXe; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-191214-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191214-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 96EDE1F22139 for ; Mon, 27 May 2024 16:21:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08E41167DAB; Mon, 27 May 2024 16:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="LtHFpVXe" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B240161305; Mon, 27 May 2024 16:15:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826508; cv=none; b=Hcdz6jup2RAjPNwLd6ZnQ+FAnRB366oMePrPUp4vRoftz9dcmB/xahx2Eqj6aHA189rQDRVcbSx8AWxJ9CigwZnoyneFDU75MbN2f3fUszvVtdTlbvlBB5fazXNOzJ0IlKBfMPXA31g58Uu1HKB0Rv5x0LCAeB1dCBU/7mmJ+44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826508; c=relaxed/simple; bh=wDXdXZDe5krRitdqjY8S6IfoignV9HVmYqJZDUl7H6c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fYlssVil9zusyPinWdXvigVb5Cy1EhtZYX0fszBQuBri5Bozk5ggjnUlIRQfh+6MMUDRjG439OrNeAsIXZGV10qY6fIUDX3KWGi5utXq5Z7bmUIVu6uoOxy7YVG6bv3pnHIK8RJAnb4ZQszjwkIvPAaAxizeAS8lkbovNk4Qo7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=LtHFpVXe; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 32A06FF814; Mon, 27 May 2024 16:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1716826503; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L6TlKweuD4lCqBxL9SdGBmVX01IhcfhXMnuiuGHqhBE=; b=LtHFpVXekRIXkrs7LdaUhIszxGChykZckIjc6rfeFQbR143lKPfrrkGozoUsSbCANSU8G+ DAmdTGQug3jbxQXkSTixWiSMeho85cZrdJXuo8EvFlE3CJvBN0k0WQeQ6D2JJPS8XAK+ix /JsVq2vmdTcuL0T+uKMtiOoU0UBJDVOTssifl+cnHUXqh6AIRVT90KgZLq7IGwru/d2Q8L wrzKQiNZSdgUopemE8Ppfor34GyNDBJIa8XNtOrtHgsMx3wdVvbs6A7P/Zs8oXUNHVprrH ZJgCcgoKQw5Cz/ep1BehMie58Ui9546uvoVSMLXNrFa4o2I72pRBJut3359Lng== From: Herve Codina To: Simon Horman , Sai Krishna Gajula , Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lee Jones , Arnd Bergmann , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= Subject: [PATCH v2 03/19] reset: mchp: sparx5: Release syscon when not use anymore Date: Mon, 27 May 2024 18:14:30 +0200 Message-ID: <20240527161450.326615-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240527161450.326615-1-herve.codina@bootlin.com> References: <20240527161450.326615-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com From: Clément Léger 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 Signed-off-by: Herve Codina --- 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