Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp951878lqm; Thu, 2 May 2024 00:07:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3U3l0GRSlXRe+ts3+PalRmxncdfISfDlAkIKWVkTgR4gmFU3aitNH15a9TyAcqZJ7UBW5+lx+tlGuymzw4sI+Iha8QD60dGLlBQyDzg== X-Google-Smtp-Source: AGHT+IG62kUo+UW0WCpeTadb4W6OU0SQHy9u0dbhVlJtWtFZY+vRQq1TTSvssKpE0c2lqW0cTSWW X-Received: by 2002:a05:6a21:1f13:b0:1ad:7e4a:d681 with SMTP id ry19-20020a056a211f1300b001ad7e4ad681mr4092469pzb.25.1714633624488; Thu, 02 May 2024 00:07:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714633624; cv=pass; d=google.com; s=arc-20160816; b=zOJVVTbq1s0+E68MJ0+cBsb/CZw3YcNOrsg4dymXUeqnBGQv6nUK4oY/4xB4udFwg1 a3pohVGLOvBm2xWaa8iGk/YsrZbwZxvi2IaG1Pyr/OiROx2s6gCKEC93RrdFLCBIRjOy cBSQPoFnqrqF/dqoUTiHY1BBEoEFh+WfhsR2LjBpF9DcBh+BXPdyinCefnLhqBLjLRFN DqIMwEUKubNqxOF6oO4861STLpnCvCR+XtWhIATDFAVCQfmNxIxsAfmxwdciq6Ug+ap6 rQFL/qtjqI/f52EJWLy9JxKATZqQzFzCu7s8l0h+l4JLkYFh/Be6Lm67XrH04qI/Ite+ DI4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=V3T3S0/ACanJIeY4czsTT+RTZ1YRol9ljsewIaXQads=; fh=ao1nwmgassPiwgO1lt/Y2TwkS1PFOqmWFYXctcLvcAc=; b=PflSWb0M9CyN/0jyTJ56eMjnaX7NWmsIvo1OtIgDhOq709m8pOw1quiBUa/eburddR mKWZYjBfrvmb08Gk6Un7x7MMmEwThFVMZ0QizWkKYs5F7i/f7J+EPsUaQHPOcSylO/CA Xhl0G6qKhYOmRg0vlwVUfI8hSEc2nU08NWYeHs4eavj5lEmGotLim/2vfjJ/NliE0FNE +/Q+yzuQhbPRDueTsvHmsN/FZNd5n4uFkXP7h8qlrbN11faXHuSX0zAdFAt25eF8iqv6 BwUdWd8iCryzQlOC4leduUEO86KBk+FHDPLTKLFtycJ19DY3B1VlZtcNuhg9WyzYUMzN ywWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zOqxvveo; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-166035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w18-20020a62c712000000b006f38489917asi501133pfg.171.2024.05.02.00.07.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 00:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zOqxvveo; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-166035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 485B5B21A73 for ; Thu, 2 May 2024 07:06:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE3733613D; Thu, 2 May 2024 07:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zOqxvveo" Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C48D23759 for ; Thu, 2 May 2024 07:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714633543; cv=none; b=PkPorhx0GJKBNdzhHa8SxXhYuUsXG7pRa2u49F8fkVTWuw+RaVwCTOGdDtVLtsUrZoj7t7vAURgdhOyNwYMTKW1voMYewlrmzV5/XhxTtFahK0lGQXvSr1gr5JEIpOmnfUWHUDJtNhdPc80b3C00EO1TPUVDfZJa68GnxJ7hTsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714633543; c=relaxed/simple; bh=jmCz2bzZzN6llSSfnEw77N01jtx9utNXMW5o87pvL2I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rbzNZJWFAXXq3Yp5gxe+XLX/nQuUQl7qftPawRLZN5AoR12vmIXvCrER/GbrZvt1B3M9S9On5QAh+3f+DS2YjJzDbfYoCY35jlDw0uRtYIEknCtyLvwAtZO39H9Xeh7UhD7cIBl6HbmTP6ShcD5OXZNXvyh1muehXQEhonIBLWs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=zOqxvveo; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2df9af57b5eso73699601fa.2 for ; Thu, 02 May 2024 00:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714633540; x=1715238340; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=V3T3S0/ACanJIeY4czsTT+RTZ1YRol9ljsewIaXQads=; b=zOqxvveoh0antj8BAs4hQvuiDTYMLbFX6Gto+PdQ7hl2MT62tfWZ1Q4ZYhaHtnVVxK VVpIqua7oEgqKx3G5v7d2vMuiLxkb0DlfBC3p4BM6nOdVMlUsIaa+kTJlCIs9k+ewaLj +KokrfVL9ldJ+4TJr2CkZZCuYk3e+4dtfQqK8vXBnTStehYk9i28w8+//9db1Hjq3xR6 odXInKjwg/237Fd3XORDBm98Y/J3mpbj05871x7CBdGrlMSDjRiYB3JQ9i41PFCs1hPh AOXbZsuPil/A2+4TO+/4QX3QT9lTJoewkZtR+VgILuC75Jwk89aEQyUtsGgAp75ZxmWa wVJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714633540; x=1715238340; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=V3T3S0/ACanJIeY4czsTT+RTZ1YRol9ljsewIaXQads=; b=UBHcbdaCB7D3TwmLvd9bWrzrXTRl7f4Y5xJ4Fya621Wt1QPSm86g9dXYkevKgm8tlV VOXHVwJJ+5gyLnoLVVB7FAtwH5FRkxbFgDSwG7MW79621KBmiJDE58kL/ojYbSNgCCk+ 4rzxzDDP/KW+Qq5uG4E6NYQBMPdg5UA9KkQ66z4pbNVr6X4s7tTKrUW3/EN3z8FuxXzh d2mfYoyHxEl3YDWYkjTpjnvqrkecj887KbgdV6Du1Vlrw93ShVTE4DsVmykPSat8ccyE XuXtGb6UCNrsS9O0luwwMaZElhbraH+pw0tsk66QL16qvPFD5BsIpjMk0AE2037ZKChD M35A== X-Forwarded-Encrypted: i=1; AJvYcCVR+qmZCOelHFXDircDWXMT1DTlaA0dQ00v1h1K7SVuFj2eJ8pjStfm+MEEOWqQBth18DbMCuQqbQCB7MNFIqO8+GLm+e0QVtklaAXL X-Gm-Message-State: AOJu0YzKnLsW23cNBpuZCt34zeXk0VoctWK68KmwKlguTqDxPrbTcToC 7MAqmrw/PULBdkxppeEfkbmDc3TWb3V//o2kWOZRfAq/4ESt1yr3WGWhV8hbS/8= X-Received: by 2002:a2e:a58e:0:b0:2d9:fb60:9afa with SMTP id m14-20020a2ea58e000000b002d9fb609afamr1096872ljp.40.1714633540084; Thu, 02 May 2024 00:05:40 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id q26-20020a2e969a000000b002d860a40f9dsm69420lji.136.2024.05.02.00.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 00:05:39 -0700 (PDT) Date: Thu, 2 May 2024 10:05:35 +0300 From: Dan Carpenter To: Peng Fan Cc: "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" , Krzysztof Kozlowski , Sylwester Nawrocki , Alim Akhtar , Geert Uytterhoeven , Patrice Chotard , Heiko Stuebner , Damien Le Moal , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Aisheng Dong , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Chester Lin , Matthias Brugger , "Ghennadi Procopciuc (OSS)" , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Sascha Hauer , Andrew Jeffery , Joel Stanley , "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" Subject: Re: [PATCH 01/21] pinctrl: ti: iodelay: Use scope based of_node_put() cleanups Message-ID: <26aab31b-8085-49e0-862d-24c26ff4d02c@moroto.mountain> References: <20240501-pinctrl-cleanup-v1-0-797ceca46e5c@nxp.com> <20240501-pinctrl-cleanup-v1-1-797ceca46e5c@nxp.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=us-ascii Content-Disposition: inline In-Reply-To: On Thu, May 02, 2024 at 12:28:42AM +0000, Peng Fan wrote: > > Subject: Re: [PATCH 01/21] pinctrl: ti: iodelay: Use scope based of_node_put() > > cleanups > > > > On Wed, May 01, 2024 at 08:55:59PM +0800, Peng Fan (OSS) wrote: > > > @@ -879,16 +874,12 @@ static int ti_iodelay_probe(struct > > platform_device *pdev) > > > ret = pinctrl_register_and_init(&iod->desc, dev, iod, &iod->pctl); > > > if (ret) { > > > dev_err(dev, "Failed to register pinctrl\n"); > > > - goto exit_out; > > > + return ret; > > > } > > > > > > platform_set_drvdata(pdev, iod); > > > > > > return pinctrl_enable(iod->pctl); > > > - > > > -exit_out: > > > - of_node_put(np); > > > - return ret; > > > } > > > > This will call of_node_put() on the success path so it's a behavior change. The > > original code is buggy, it's supposed to call of_node_put() on the success path > > here or in ti_iodelay_remove(). > > > > If it's supposed to call of_node_put() here, then fine, this is bugfix but if it's > > supposed to call it in ti_iodelay_remove() then we need to save the pointer > > somewhere using no_free_ptr(). Probably saving ->np is the safest choice? > > > > The original code is already a little bit buggy because it doesn't check for > > pinctrl_enable() errors and cleanup. > > It was introduced by > commit 6118714275f0a313ecc296a87ed1af32d9691bed (tag: pinctrl-v4.11-4) > Author: Tony Lindgren > Date: Thu Mar 30 09:16:39 2017 -0700 > > pinctrl: core: Fix pinctrl_register_and_init() with pinctrl_enable() > > of_node_put is expected in probe, not in remove. > Ah, right. You'll add that for the Fixes tag obviously... regards, dan carpenter