Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1876964lqa; Tue, 30 Apr 2024 01:40:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1YfGDFoHI+S92Yb85TrKXFzfCMd8erOi98q/a5BAc0nKG1zhzX6FNOd+nY8RfcYs9Rpo5BtJAMErMKsKXuHR+RhA9od4dzE0qSMZUeA== X-Google-Smtp-Source: AGHT+IGzxPtDuWGb/+waFYVRLrzTSIqORoYP+T1y2CBYhrlxqeV7H+HSzUmuhT8/wBrB3W0UDvgn X-Received: by 2002:a05:6a21:33a2:b0:1aa:a6cc:39c5 with SMTP id yy34-20020a056a2133a200b001aaa6cc39c5mr18879104pzb.7.1714466408681; Tue, 30 Apr 2024 01:40:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714466408; cv=pass; d=google.com; s=arc-20160816; b=vER8jKVUl93g90nuqZEv0RI9uTsRNXaL9U/jcNhbuvdNREmjQmZJnXtLPJk9aQUjE5 zmgaz3w68Aw70Rv5lmzLE75IWZqrA/hNe1/e31m1iyQeXHjsUTLpXWzXDKPJdGi6iKxX LfV+j/jBfuSjgGLfQ0Vb5mw/dnTXrCpVhHVe5maUTL0c4PYxmms6VVJNPqo/AKcU2/1W w6Pyu/0D0nU/tkgxNXdmQOIav0TJE3iBzA/CmS2+5xeeeTT2jw907Gy4valtxemFwufL GqrXEyEs3TYxfKUvbY0ylrMBzZNl/jKLQMXVKJmwc2G0rdf380qG4CWD0KWDaumO/UPg 4/Bw== 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=qxAq7qxzKoem8aXbH9fXtuWzQPqQzhAER6fvu7zb1R4=; fh=FZ8lJPkZghXo7cjjk5LlG/r+nFxaAY6dY38taoG8W1o=; b=Fs6lnEFQnCG9wM6RSJTF3yuDC0oakdFj/rW9Lp0jMLqD9HyuPiDlvSI0NMv7a8+3+I YWUYkBQzIiragFnocpu9cAXzfSOS1ew9L59RQNgPWcsFrrh0SFsYAx/DhmS2UsR6IUDF kTQyOH6ib1NIhH2dO7J7IwsnxpKE8G09vDnddAU4o0ZVpGNP5dyw4IrCo+l4pg3mOZlx AjgcKefqKC+ISUDFXaeHI7k6cikqeC9RDii3gCs/J2PzGWi4VLLlfi71e6oPr0MhafYi 3yCoLiFpMKGMed/yLklggy33u1jxWTafbdU6GQI6u7KwLbMKIxj43f8nv/aHXNb56h4O LqJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ei6Cc0i5; 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-163553-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163553-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b12-20020a170903228c00b001ec22748217si1596036plh.587.2024.04.30.01.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163553-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ei6Cc0i5; 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-163553-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163553-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 52F65281EBB for ; Tue, 30 Apr 2024 08:40:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C446129A93; Tue, 30 Apr 2024 08:39:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ei6Cc0i5" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 31F61128376; Tue, 30 Apr 2024 08:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466357; cv=none; b=i4ZIJMf1MTJbPzeOS0RBnr/iOhpmbaOax0xzUK7LNpQNFSPQfhFB21c9ULg/9NO+f/V/KPspfrmw/NUbBWqaZH2Hf8UDKHWiKNmVmMg72F9NekhtR3ofOKdDh0yp1fBYuwi/AkyetjaBnDc5PR9RE2ABn573Rs2nXIA2Rz3AGlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466357; c=relaxed/simple; bh=QvIZPcFIxECl5ypxatKmykPf8ABcwLk+5NAwN21I9+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cSeWZfS4gnZsMfgMa+rQoBkvubbPbXWOi6L3m3zV0j5X8f4Z34o+k6+mqS+GsES/iC3Z4bCRkDlaOhFZVY/FblhzS1VdDhAb1GoeMENVkmwf56NHCd6eG8pPxfTXbkE+ewzCtJ+Q2eCDSlY9Qi1kKLuQ2dcFveOzJgAbRaaI5DA= 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=ei6Cc0i5; arc=none smtp.client-ip=217.70.183.200 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 E117B20010; Tue, 30 Apr 2024 08:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714466353; 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=qxAq7qxzKoem8aXbH9fXtuWzQPqQzhAER6fvu7zb1R4=; b=ei6Cc0i5Tyy6hry1zGIuvQ738sLwbRXunJcfF5AXysqct4QsgJI1HqHFs5KG5LW6qrGPX4 NrKBs8HIy8IYahz7V0CtSsHA14Fsb3pCZjnRfliX9knEypLMmO6mAcI6nYK2djDCI88vqP edWu0zy+Y9dUbMZNcm3Cg+ZssEjU6FTHBBBEeIS4eqFixUCraHl3mFFigtomyo17bOXHWp hmtGGLrlWfo+aJaB/ixdz9fq/btWAre7sYQMti3JLyJO4W5WrVSneohrBnhYJ4p+CTJJ8w sRsxu8MQKxmpVLAI2VxKXfWCdKS/jwRyokyBEQ6bEU3SiJ+8NEI4yYjECkl5+g== From: Herve Codina To: 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 03/17] reset: mchp: sparx5: Release syscon when not use anymore Date: Tue, 30 Apr 2024 10:37:12 +0200 Message-ID: <20240430083730.134918-4-herve.codina@bootlin.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430083730.134918-1-herve.codina@bootlin.com> References: <20240430083730.134918-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.44.0