Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp590784lqm; Wed, 1 May 2024 09:35:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrtxQpge9Z5DHIpISpt7TeDDPj+WDa1Kw9T4LEkI0V75DdwNWao3gvNPg1zw0qybWPak4yFL6nYVTT9AX0gbTb8QKUb0q5LJUiLSAYrQ== X-Google-Smtp-Source: AGHT+IHIFvO4uv/KFmF2dxeEJYVj+0InE0xSoYJKxzpnAC727XKjNdPJ/1LCtwXgEkUl5Xk4STrx X-Received: by 2002:a05:6871:340d:b0:23d:9f6b:5d41 with SMTP id nh13-20020a056871340d00b0023d9f6b5d41mr1553440oac.0.1714581319048; Wed, 01 May 2024 09:35:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714581319; cv=pass; d=google.com; s=arc-20160816; b=lnJ8tYYM8ALeu9uJqUS1S/PWPiMAifg08qk3WOAY6fVo8Z6mpj9MNddALqpLlhHAr2 9ACS68bWtbW5qwKtcRvweRcWnk9J4ZkCf74NjHY3wyAj746viqm48+ki0zD8DbHmh1Ud AOm0RPQVoMaQMM9Wm+I9EtKRalk7Q7f50ZvJbmDDeWqMx76T7tq4zwF06NGXoN3vei4I acIcYkdBdW3l1GswPd5waFw/wKJOK17dGeoWJfu4TDZ65b5ZTNVXbt28UexexNhHPxz+ bqNpFZVfBm0bbwgIgmRcBAAEH7G7JlF6I+/Ky92yAcWszwQs42TAihUOyixgYMEWc3nA dDUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=phUiUfW9d31X5sn0OROpCDTxf0nA6VMVW2FwYbdctaU=; fh=D4fy9Ja1mCF9ijD28f3tyAOBka9JUyqD2KHgNGPHT6Y=; b=F+N1zhheZkuyMKGlvQjHqan6kK0o3wRaXpBEcNbO+CRMG9qM+DvCRGCPXNl6O4YQAy CxmXJiRWYLWJQR5CI4aKUkgcpP5vbUksLwq8kzLHHpOE1lzVSPO+AQDDGVhcN0wekThs 4u8qhZlUW59nFF/h4ApTk5Vw+nwMWjwF0xjQJ6dxPeIn09yJKW6dPTfcZQT0bto2TMTv M76uYGQg3OkeeeSgbbruv03ShUAOKpphAaxqsZUk5xkPLmbtvw5dOuzpezNwatm3DEFz Fydqr0a6Cf9agyKGV6cFyrhQkWG0Q5yMllGwK44o1nBQfckCFgBtz9yXMXvnXL9JPOf3 UlwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=G1BQgOiw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j1-20020a056102000100b0047c06755d5bsi3374623vsp.706.2024.05.01.09.35.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 09:35:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=G1BQgOiw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B99311C21911 for ; Wed, 1 May 2024 16:35:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA5F1DDBC; Wed, 1 May 2024 16:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G1BQgOiw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9872F134BD; Wed, 1 May 2024 16:35:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714581307; cv=none; b=nBkZYV7VKsr4TbOD8bdfglwNGugmaPWUdSb/fv2hd3oO2HWQjrzirew+0p1HNN6h3n0shd/VfKPfTgPsjVu3hgyEu/sRR0eSYLDQ8lSFY68QIoNk7mprST/b4B8R54OlJROk1n+Rl9cLw00A5KRMJMVRy9FTz+gam8ILFirIdJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714581307; c=relaxed/simple; bh=bjFD0rHxLsC2c7Uw5VnvdgzaWdEjNPdDAmFkEgyLG4E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N0Jmlyaj6Iy1J0vTPl5Wm8Mw0YVMmOC0tL0yYwY8j5xjuOGaulD0xLYmMbUblX5zmHSs4981y0SDKfkKobxnh9aEJY6hxK3kIO6w38Jsk4ob66vm7QnzlissPfylbv9+Ba1425/VNqTZ38X5jn9JPCjd9dlvh7VN5i6CX3pmrZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G1BQgOiw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A123FC072AA; Wed, 1 May 2024 16:34:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714581307; bh=bjFD0rHxLsC2c7Uw5VnvdgzaWdEjNPdDAmFkEgyLG4E=; h=Date:Subject:List-Id:To:Cc:References:From:In-Reply-To:From; b=G1BQgOiwmAz/rQreDqB3fQkhY3McXS3qtH7HRtubCWgIsbrhT5mqOR3TtopXNkf84 wIocaw9hrFPybHdnYvEtfb+NBydjQrly76XIDBUfqEL1f5WwKSKdzANMm0/e/KfjAn QjgU4inFW6xPGpQ2+OhYi83rXZ6E4Lc7nJ54qRhJf3f/wwAiVNonz5MoVNbgJvHLtD ZgpRsGO/xLiDXgoBVuCZMhmobuIWTegqFGBRRNpiyj/HH8EySqGNgqwA1sDPDomArH cKCYjQdpoPXBjN3SEXFH2z1WLDZKFxXgrcAW72mzrbTfuXjZDaxMnR0qnpb+8hDsFl /oWKk4wwInhgQ== Message-ID: <34193501-5b7b-4ffd-8549-a04c6930d02d@kernel.org> Date: Wed, 1 May 2024 18:34:47 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 08/21] pinctrl: samsung: Use scope based of_node_put() cleanups To: "Peng Fan (OSS)" , Linus Walleij , Thierry Reding , Jonathan Hunter , Dvorkin Dmitry , Wells Lu , Maxime Coquelin , Alexandre Torgue , Emil Renner Berthing , Jianlong Huang , Hal Feng , Orson Zhai , Baolin Wang , Chunyan Zhang , Viresh Kumar , Shiraz Hashim , soc@kernel.org, Sylwester Nawrocki , Alim Akhtar , Geert Uytterhoeven , Patrice Chotard , Heiko Stuebner , Damien Le Moal , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Sascha Hauer , Andrew Jeffery , Joel Stanley , Dan Carpenter Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-samsung-soc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Peng Fan References: <20240501-pinctrl-cleanup-v1-0-797ceca46e5c@nxp.com> <20240501-pinctrl-cleanup-v1-8-797ceca46e5c@nxp.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bP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muxYLJ7lnbLYH1oui8bLbMBM8S2Uo9RKqV2GROLi44enVt vdrDvo+CxKj2K+d4cleCNiz5qbTxPUW/cgkwG0lJc4I4sso7l4XMDKn95c7JtNsuzqKvhEVS oic5by3fbUnuI0cemeizF4QdtX2uQxrP7RwHFBd+YUia7zCcz0//rv6FZmAxWZGy5arNl6Vm lQqNo7/Poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <20240501-pinctrl-cleanup-v1-8-797ceca46e5c@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 01/05/2024 14:56, Peng Fan (OSS) wrote: > From: Peng Fan > > Use scope based of_node_put() cleanup to simplify code. > > Signed-off-by: Peng Fan > --- > drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 3 +-- > drivers/pinctrl/samsung/pinctrl-exynos.c | 16 ++++------------ > drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 8 ++------ > drivers/pinctrl/samsung/pinctrl-samsung.c | 26 +++++++------------------- > 4 files changed, 14 insertions(+), 39 deletions(-) > > diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c > index 85ddf49a5188..9a57b3ceb536 100644 > --- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c > +++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c > @@ -56,7 +56,7 @@ s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, > const struct samsung_retention_data *data) > { > struct samsung_retention_ctrl *ctrl; > - struct device_node *np; > + struct device_node *np __free(device_node) = NULL; > void __iomem *clk_base; > > ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); > @@ -71,7 +71,6 @@ s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, > } > > clk_base = of_iomap(np, 0); > - of_node_put(np); I don't think the code as simpler. Previous was very easy to read, obvious, no error paths. To me any conversion of such of_node_get immediately followed by of_node_put is unwelcomed. Easy code is being converted to complicated one. Best regards, Krzysztof